9 Architecting for the Cloud: Trading Pets for Cattle and Concrete for Code
This chapter covers
- The important mindset change from seeing servers as "Pets" to treating them as disposable "Cattle."
- Navigating the Compute Spectrum: making architectural tradeoffs between Control (Containers) and Convenience (Serverless).
- Why you must use Infrastructure as Code (IaC) to write your servers exactly like you write your software.
- How one simple typo caused a major internet outage, and why manual changes in production are a bad idea.
- Scaffolding your first automated cloud service
9.1 Introduction
There is a legendary phrase spoken by every junior developer at least once in their career. You finish writing your code, you run your tests, everything looks great, and you proudly push your code up. Five minutes later, the QA engineer or your lead developer taps you on the shoulder and says, "The app is crashing."
You look at them, confused, and utter the famous last words:
"Well, it works on my machine!"
So far, we've been working in the safe, familiar world of your own machine. Imagine your code as a sturdy paper boat floating in a calm bathtub, protected from any storms. But architecture doesn’t matter if it never leaves home. Eventually, you have to send that boat out, and once it reaches the vast open sea of the cloud, everything changes.