fullstack_webdev

Code and notes from Full stack web developer path, LinkedIn Learning.

View on GitHub

1. DevOps Basics


01_01 What is DevOps?


01_02 DevOps core values: CAMS


01_03 DevOps Principles: The Three Ways


01_04 Your DevOps Playbook

  1. People Over Process Over Tools: It’s about identifying the person responsible for a job function first, then defining the process that needs to happen around them, followed by selecting and implementing the tool to perform that process.

  1. Continuous Delivery: It’s the practice of coding, testing and releasing software frequently in really small batches, so that you can improve the overall quality and velocity. It’s been shown in studies that in CD environments the team spends 22% less time on unplanned work and rework. Changes have a three times lower failure rate, and the team recovers 24 times faster from failures. It works for all kind of workloads.

  2. Lean Management: It consists of using small batches of work, work in progress limits, feedback loops and visualization. The same studies showed that lean management practices led to both better organizational outputs, including system throughput and stability along with less burnout and greater employee satisfaction at the personal level.

  3. Changed Control: In the book Visible Ops, it was revealed that there is a direct correlation between operational success and control over changes in your environment.

  1. Infrastructure as Code: Systems should be treated like code, system specifications should be checked into source control, it should go through code review, whether a build, an automated test and then we can automatically create real systems from the spec and manage them programatically. With think kind of programatic system we can compile, run, kill and run systems again instead of manually creating handcrafted permanent fixtures that we maintain manually over time. You could say, we used to treat servers like pets, now we treat them as cattle. Visual representation of: Code To Cattle, oops! I mean Code to Servers 😅


01_05 Ten Practices for DevOps Success: 1 to 5

  1. Chaos Monkey: Old school systems development theory advocated for making each component of a system as highly available as possible. This is done in order to achieve the highest possible uptime. A transaction that relies on five 99% available components will only be 95% available because duhh, math! Instead, focus should be on making the overall system highly reliable, even in the face of unreliable components. Netflix invented Chaos Monkey, to ensure they were doing reliability correctly. Chaos Monkey watches the Netflix system that runs in the Amazon Cloud and occasionally reaches out and trashes a server just kills it. This forces the developers and operators creating the systems to engineer resiliency into their services instead of being lulled into thinking that their infrastructure is always on.

  2. Blue Green Development: Traditionally in software development, you take down the software on a server, upgrade it, bring it back up and then you might even do this in a rolling manner, so you can maintain the system uptime. An alternate deployment pattern is blue/green deployment. Instead of testing a release in a staging environment and then deploying it to a production environment and hoping it works, instead you have two identical systems, blue and green. One is live, and the other isn’t. To perform an upgrade, you upgrade the offline system, test it, and then shift production traffic over to it. If there’s a problem, we shift back to the Blue.

  1. Dependency Injection: In a modern application connection to external services, 3rd party apis and rest services etc. is the reason for most of the runtime issues. There is a software design pattern called dependency injection or inversion of control. This focuses on loosely coupled dependencies. In this pattern, the application shouldn’t know anything about its external dependencies. Instead they are passed into the application at the runtime.

  2. Andon Cords: This is an innovation originally used by Toyota on its production line. A physical cord, like the stop request cord on a bus that empowers anyone on the line to pull to stop ship on the production line because they saw some problem. We can do the same thing for software delivery pipeline. This would allow you to halt an upgrade or a deployment to stop the bug from propagating downstream.

  1. The Cloud: The DevOps love of automation and desire for infrastructure’s code has met a really powerful ally in the cloud. Most compelling reason other than cost optimization to use cloud services is that the cloud solutions give you an entirely API-driven way to create and control infrastructure. This allows you to treat your systems infrastructure exactly as if it were any other program component. You can try new development and disaster recovery strategy, you can try it out on test deployment, without waiting for others. Cloud approach to infrastructure allows your other DevOps changes move along at a high velocity.

01_06 Ten Practices for DevOps Success: 6 to 10:

  1. Embedded Teams: Classic DevOps problem, dev team wants to ship new code, and Ops team wants to keep the service up, if you look closely, you will see there lies an inherent conflict of interest. One way is to be skeptical and guess your way through it. A much better way is what some teams started to embed an operations engineer on each development team and this makes the team responsible for all of its own work, instead of passing on the requests to another team into some queue for operations team and telling them what to do. This allow both teams to closely coordinate with their goals aligned, the success of the service.

  2. Blameless Postmortems: Decades of research on indsutry safety disproves the idea that there is a single root cause for an incident. So, you cannot use human error as an acceptable reason of failure. While examining failures goal should be to learn from them as much as you can, avoiding logical fallacies or relying on scapegoating to make ourselves feel better, while making real situation worse. Blameless Postmortems and Just Culture Blog

  3. Public Status Pages: Services go down, they have problems, it’s understandable and a fact of tech life. I mean YT and Instagram can be down, a little down time is not the end of the world right! Only thing that has shown to increase customer satisfaction and retain trust during these outages is communication. A good read on this is Lenny Rachitsky’s Blog Transparent Uptime was a tireless advocate for creating public status pages and communicating promptly and clearly with service users. Tell the users what the problem is, what is being done and after the issue is resolved tell what you have learned to prevent such incidents in future.

  4. Developers On Call: Approaching products as an IT organization with a philosophy of let’s make and ship the features and someone else will be responsible for making sure it works, say outsourcing the support etc. Needless to say, this hasn’t worked out great and usually leads to poor customer satisfaction. Teams now put developers on call for the service they created. This leads to very fast feedback loop. Logging and deployment are rapidly improved and core application problems get resolved quickly, instead of lingering for years while making some network operations center person restart the servers as a workaround.

  5. Incident Command System: Old school incident response techniques only apply to really large scale incidents. Real life incident response experience suggest, mostly it is a mix of small incidents with only an occasional large one. A great read on this is Brent Chapman's Incident Command for IT which you can see here. It goes over comparing incident response in real world and explains how the same process can work for IT.


01_07 DevOps Tools

  1. Tool should be programmable, be able to play nice with other systems, while performing its work in an automated manner. You should be able to call it and invoke it from an API or the command line. Tools that are only UI driven, they are going to prove to be poor choices of your tool chain.

  2. You want the tool to be verifiable. Trust, but verify. Best kind of DevOps tools exposes clearly what it is doing and provide some manner of validating that it did infact what it sets out to do. Events and metrics from your tools are an important source of feedback.

  3. It has to be well behaved both from a developer point of view, and an operations point of view. You should be able to check the tools configuration in the source control, it should come with tests that can be used to verify its behavior and you should be able to deploy it in an automated manner.

Also, follow the above tools criteria when developing your own tools in DevOps to fit your custom requirements.

01_08 FAQs