---image: "Math and Computation/Databases/Postgres/assets/chap_8_cloud.png" publish: true description: "The Cloud Scales: How the absolute laziest elephants outsource the exhausting reality of physical storage entirely over the network using Aurora, AlloyDB, or Neon." --- ![[chap_8_cloud.png]] # Chapter 8: The Cloud Scales (Outsourcing Labor) We have reached the absolute zenith of laziness. Throughout this entire book, we've watched the elephant go to extreme lengths to avoid walking to the physical filing cabinet. It builds `Indexes` to avoid scanning. It crosses things out with `MVCC` to avoid erasing. It furiously scribbles in the `WAL` to avoid properly committing `Pages` to random spots on the disk. But ultimately, the elephant is still constrained by the brutal reality of the physical server it lives on. If the hard drive is slow, the elephant is slow. If the server runs out of disk space, the elephant dies. What if the elephant could just... outsource the filing cabinet entirely? ## Decoupling Storage from Compute In traditional Postgres, the Elephant (the Compute engine calculating the Query Plans) and the Filing Cabinet (the actual Storage disks) live in the same box. If you want a bigger filing cabinet, you have to buy a bigger box, turn off the elephant, safely move all the files, and turn it back on. This is exhausting. Cloud databases (like Amazon Aurora, Google AlloyDB, and Neon) introduce a revolutionary concept: **Decoupling Storage from Compute**. In these architectures, the elephant is still sitting at its desk, reading SQL queries and building battle plans. However, when it goes to write to the `WAL` diary or fetch a `Page`, it doesn't talk to a local hard drive. Instead, it yells over a massive, specialized, hyper-fast network to an entirely different division of the company—a massive, redundant, distributed cluster of storage nodes whose _only job in life_ is to manage filing cabinets. This allows the elephant to be lazier than ever before: - **[[Aurora|Amazon Aurora]]**: The elephant doesn't even bother writing `Pages` anymore. It just streams the `WAL` diary frantically across the network, and the storage layer has thousands of micro-elephants reading the diary and constantly updating the filing cabinets themselves. - **[[AlloyDB|Google AlloyDB]]**: The elephant integrates an incredibly aggressive analytical cache, so it can answer mass-aggregation questions instantly without even pretending to look at the disk. - **[[Neon]]**: The ultimate modern convenience. Because the filing cabinet is completely detached and entirely network-based, you can duplicate it instantly. You can branch your production database like a Git repository without copying a single byte of actual data. The elephant just wakes up and points at a slightly different virtual filing cabinet.