Amazon Web Services
As cloud elasticity forces every developer to build distributed applications, teams must rely on standardized consensus primitives rather than custom protocols that inevitably fail under rare scale anomalies.
AI-assisted summary of AWS re:Invent 2014 | (SPOT302) Under the Covers of AWS: Its Core Distributed Systems — original source. Check the original for full context.
Source published:
Key ideas
- Every modern application deployed on the cloud is inherently a distributed system, forcing developers to build resilient software over commodity hardware rather than relying on custom fault-tolerant machines. (3:45)
- Core distributed systems primitives like group membership, discovery, failure detection, and workflows ultimately reduce to the fundamental problem of distributed consensus. (37:25)
- Allan Vermeulen posits that every consistent distributed system either relies on a single point of failure, implements Paxos at the bottom of its stack, or is fundamentally broken. (40:00)
- Amazon's consensus architecture evolved from raw Paxos libraries to a centralized lock and lease service, ultimately landing on transactional journals that underpin services like Amazon Kinesis and DynamoDB Streams. (43:00)
Detailed notes
## Background Published on YouTube by Amazon Web Services on November 18, 2014, this AWS re:Invent 2014 presentation explores the core distributed systems primitives used across AWS and Amazon.com. The talk outlines how foundational building blocks—such as consensus mechanisms, scalable key-value stores, transactional logging, query layers, and elastic compute—evolved over 18 years to meet high durability, reliability, and scale requirements.
## TL;DR AWS engineers Allan Vermeulen and Swami Sivasubramanian examine how cloud elasticity, commodity hardware, and growing scale turned every application builder into a distributed systems developer. They break down essential distributed primitives, including group membership, service discovery, metadata stores, failure detection, and idempotent workflows, contrasting naive approaches like static files and gossip protocols with robust consensus systems. The presenters demonstrate that distributed consistency ultimately demands either a single point of failure, a proven consensus algorithm like Paxos, or inevitable failure under edge cases. Finally, they trace the operational evolution of consensus at Amazon from shared code libraries and lock managers to the ACID-compliant transactional journals powering services like Amazon Kinesis and DynamoDB Streams.
## Atmosphere & style The presentation balances deep architectural wisdom with an easygoing, conversational rapport between two veteran engineers who co-designed parts of Amazon's earliest cloud services. Their delivery alternates between wry humor—using jokes about hunters and personal flying anecdotes to explain fatal distributed dilemmas—and blunt engineering warnings against custom, unproven consensus protocols. Listening feels like sitting in an insider architectural post-mortem where hard-earned production scars from managing massive scale are distilled into clear, practical principles.
## Bulletin - [03:45](https://www.youtube.com/watch?v=QVvFVwyElLY&t=225s) Every modern application deployed on the cloud is inherently a distributed system, forcing developers to build resilient software over commodity hardware rather than relying on custom fault-tolerant machines. - [37:25](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2245s) Core distributed systems primitives like group membership, discovery, failure detection, and workflows ultimately reduce to the fundamental problem of distributed consensus. - [40:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2400s) Allan Vermeulen posits that every consistent distributed system either relies on a single point of failure, implements Paxos at the bottom of its stack, or is fundamentally broken. - [43:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2580s) Amazon's consensus architecture evolved from raw Paxos libraries to a centralized lock and lease service, ultimately landing on transactional journals that underpin services like Amazon Kinesis and DynamoDB Streams.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=0s) Hardware gains under Moore's Law do not reduce engineering effort because user expectations for lower latency and massive scale continually expand. - [03:45](https://www.youtube.com/watch?v=QVvFVwyElLY&t=225s) Data centers have transitioned from monolithic rooms built around a single mainframe to massive fleets running hundreds of thousands of commodity servers. - [05:40](https://www.youtube.com/watch?v=QVvFVwyElLY&t=340s) Cloud architecture shifts fault tolerance from expensive, specialized redundant hardware to smart software running on commodity hardware. - [10:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=600s) Partial failure is the hardest distributed challenge because individual components can crash or become unreachable without the whole application crashing together. - [15:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=900s) Group membership must resolve the risk of split-brain states when network partitions prevent nodes from agreeing on write quorums. - [20:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1200s) DNS is ill-suited for rapid service discovery in dynamic clusters due to aggressive multi-tier caching and poor support for dynamic failover. - [21:28](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1288s) Gossip protocols enable peer-to-peer discovery without central bottlenecks, but divergent views of group membership introduce subtle production bugs. - [24:12](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1452s) AWS standardized bootstrap and discovery around dedicated metadata stores like DynamoDB, prioritizing simple key-value lookups over relational joins. - [27:32](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1652s) Modern commodity clouds cannot use physical I/O fencing, making it impossible to definitively differentiate between a crashed server and a network delay. - [30:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1800s) Distributed systems must monitor liveness via heartbeats and favor time-bound leases over indefinite locks to prevent permanently stranded resources. - [35:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2100s) Long-running distributed operations require asynchronous workflows broken into small, stateless, and strictly idempotent activities. - [37:25](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2245s) Group membership, failure detection, and workflows all fundamentally depend on solving consensus. - [41:52](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2512s) Ad-hoc or 'fuzzy' protocols claiming consistency without formal consensus mechanisms inevitably fail under rare cloud-scale edge cases. - [43:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2580s) Consensus primitives are most effective when surfaced as transactionally consistent journals of state transitions rather than raw Paxos state machines or lock APIs. - [45:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2700s) Developers should utilize higher-level managed services like S3, DynamoDB, and RDS rather than building distributed consensus and storage primitives from scratch.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=0s) Origins of AWS Storage and the Housekeeping Paradox
Al Vee introduces himself as an engineer with Amazon Web Services for more than ten years. He reminisces that almost exactly a decade prior, he sat in an offsite meeting just off Amazon's main campus around a table with Swami Sivasubramanian and a few colleagues, brainstorming the concept of a cloud storage solution. Just weeks after that meeting, the Amazon S3 team was officially formed and set to work. Swami introduces himself as part of the database services team, overseeing DynamoDB, other non-relational database services, and the core AWS database platform that underpins both AWS and Amazon.com. The talk focuses on how systems like S3 and DynamoDB were engineered and examines the foundational distributed systems primitives developed along the way.
```mermaid flowchart TD accTitle: The Housekeeping Paradox in Distributed Systems accDescr: Diagram showing how technological efficiency leads to increased scale and rising expectations rather than free time.
subgraph Household["The Vacuum Cleaner Paradox (1905–Mid 20th C.)"] A["Skinner Vacuum (1905):<br/>Portable electric cleaning"] --> B["Vacuums become lighter,<br/>smaller, and cheaper"] B --> C["Expectations of cleanliness rise"] B --> D["People buy larger houses (scale expands)"] C & D --> E["Result: Housework time does not drop"] end
subgraph Computing["The Computing Parallel (Moore's Law Reality)"] F["Hardware capacity grows<br/>(Moore's Law)"] --> G["Applications demand lower latency<br/>and massive scale"] G --> H["Big Data and Web expectations compound"] H --> I["Result: Software must constantly be re-engineered"] end ```
To explain the forces driving distributed systems, Al steps back to the early 20th century to draw an analogy with household cleaning. In 1905, the Skinner vacuum debuted as the first portable electric vacuum cleaner, kicking off a "Moore's Law for vacuum cleaners" where appliances rapidly became lighter, smaller, and more ubiquitous. Popular wisdom held that electric vacuums would eliminate domestic chores, giving people copious leisure time to read or appreciate the arts. As Swami points out, the reality was entirely different: two factors conspired against it. First, societal standards of cleanliness rose; second, as cleaning became easier, people bought significantly larger houses.
Swami links this directly to modern computing: despite Moore's Law, legacy software from two years ago does not simply run twice as fast to automatically meet business goals without intervention. Instead, customer expectations continually ratchet up toward lower latencies and higher throughput for platforms like Amazon.com, DynamoDB, and S3. As Swami frames the primary force driving their architectural evolution:
> “So one of the frustrants that actually, what we are seeing driving the growth in distributed systems in Amazon and many of our AWS customers as well, is that there is this ever-running race between computing power and expectations.”
- The Skinner vacuum, invented in 1905, launched the era of portable electric household appliances. - Expanding architectural scale and heightened end-user expectations counteract the raw efficiency gains of underlying hardware.
---
[03:45](https://www.youtube.com/watch?v=QVvFVwyElLY&t=225s) The Scale Explosion: From Single Mainframes to Massive Fleets
Al introduces a second major industry trend using an architectural photograph of the University of Waterloo’s Mathematics and Computer Building, built in 1967. Touring the university as a high school student, Al looked down from an elevated gallery into a basement room specially designed to house a single mainframe computer—an IBM System/370. That era was defined by building an entire data center to house just one monolithic machine.
```mermaid flowchart LR accTitle: Paradigm Shift in Server Deployments accDescr: Transition from a 1960s single-mainframe room to modern AWS data centers holding hundreds of thousands of servers.
subgraph Past["1967: University of Waterloo Model"] M["Single Mainframe<br/>(e.g., IBM System/370)"] DC1["Data center built to house exactly one machine"] end
subgraph Present["Modern Cloud Architecture"] F["Fleet of Hundreds of Thousands of Servers<br/>per Data Center"] AZ["Multiple Availability Zones & Tiers"] end
Past ==>|"Decades of Distributed Evolution"| Present ```
Contrasting that model with contemporary reality, Swami notes that while exact server counts per Availability Zone remain confidential, modern data centers house hundreds of thousands of servers running simultaneously. Applications can no longer be deployed onto an isolated box attached to a single database. Failure modes now span complex multi-tier topologies across geographically separated sites. Distributed computing has migrated out of academic research and into mainstream development:
> “And every app is becoming a distributed app. And every developer is becoming a distributed developer, whether they like it or not.”
- The University of Waterloo completed its dedicated computing facility in 1967 around a single IBM mainframe. - Modern AWS data centers house hundreds of thousands of individual server instances rather than solitary host mainframes. - System failures must now be modeled, detected, and handled across distributed service tiers rather than local execution threads.
---
[05:40](https://www.youtube.com/watch?v=QVvFVwyElLY&t=340s) Hardware Reliability vs. Smart Software and the Legacy Architecture
Al uses his personal airplane to explain a third fundamental trend: how engineering approaches fault tolerance. In aviation, in-flight component failure carries catastrophic consequences, leading aeronautical engineers to build massive mechanical redundancy into the craft itself. Every engine cylinder in Al's airplane has two spark plugs powered by two completely independent ignition systems, backed by dual batteries, dual alternators, two fully separated electrical networks, five onboard GPS units, and an iPad. In the late 1990s, enterprise computing followed the exact same philosophy: companies purchased expensive, specialized, multi-homed servers loaded with redundant power supplies, multi-path network interfaces, and fail-safe components.
```mermaid flowchart TD accTitle: Late 1990s Amazon.com Client-Server Architecture accDescr: Architecture of early Amazon.com showing web requests hitting Unix onlines that talk directly to a shared database.
subgraph WebFleet["Frontend Web Tier"] C["Client Requests"] --> O1["Online Unix Host 1"] C --> O2["Online Unix Host 2"] C --> ON["Online Unix Host N"] end
subgraph DatabaseTier["Shared Monolithic Storage"] O1 & O2 & ON --> DB1[("Primary Database (Sized for Q4)")] O1 & O2 & ON -.-> DB2[("Secondary Database")] end ```
Swami points out the hidden cost of relying on heavily customized, fault-resilient hardware: while it initially allowed teams to write simpler software by masking hardware faults, it ultimately failed when deep, non-redundant failures emerged. Modern architectures flip this balance completely, moving away from expensive monolithic hardware in favor of commodity machines paired with resilient, intelligent software:
> “It is all about commodity hardware that you can actually get on the cloud, but what developers are forced to think about now is that they've got to build smarter software.”
Al illustrates how these three trends collided by showing an archival image of Amazon.com from the 1990s. The original system was a classic client-server architecture: an array of Unix hosts—referred to internally as "onlines"—accepted incoming web requests and directly queried a shared database backend. Sizing this infrastructure created an operational dilemma:
| Metric / Period | Q4 Peak (Holiday Shopping) | Q1 Trough (Post-Holiday) | |:--- |:--- |:--- | | **Online Fleet Load** | Running at capacity limit to survive holiday purchasing surge | Excess fleet running mostly idle | | **Database Sizing** | Monolithic database scaled up to survive catastrophic peak load | Over-provisioned, oversized database capacity going to waste | | **Operational State** | Engineers “hanging on and survive barely by the skin of our teeth” | Locked into non-downscalable capital expenditure |
To handle the immense Christmas shopping rush, Amazon had to provision and buy peak-capacity fleets of online hosts and gigantic databases. Teams barely survived the fourth quarter, only to be left in the first quarter with massive, idle compute and storage investments that could not be scaled down dynamically. This rigidity led directly to the development of auto-scaling groups and elastic infrastructure.
[10:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=600s) The New Reality of Distributed Systems
In modern cloud environments, computing resources are no longer static boxes provisioned for years; they auto-scale on an hourly basis. This elasticity extends all the way down to the database tier, where storage and compute scale dynamically up and down. This shift establishes a fundamental paradigm: “With cloud, elasticity is the new normal.” For engineers, this introduces immense architectural complexity because systems must manage a constantly changing topology of processes and servers rather than relying on a predetermined fleet.
This operating landscape is defined by four foundational realities: 1. High expectations paired with enormous scale. 2. The architectural truth that every modern application is inherently a distributed system. 3. Ubiquitous commodity hardware. 4. Pervasive elasticity across all tiers.
```mermaid flowchart TD accTitle: Distributed Systems Realities and Consequences accDescr: Mapping four industry realities to the concrete challenges faced by distributed systems developers. subgraph Realities["Industry Realities"] R1["Elasticity & Commodity Hardware"] R2["Every App is Distributed"] R3["High Expectations at Scale"] end subgraph Challenges["Engineering Challenges"] C1["Latency & Concurrency Overhead"] C2["Partial Failures & Disjoint Fate"] C3["Dynamic Topology (No Static Configs)"] end R1 --> C3 R2 --> C1 R2 --> C2 R3 --> C1 ```
Developers who learned computer science by decomposing systems into local subroutines or objects are caught off-guard by the distributed transition. While remote procedure calls (RPCs) syntactically resemble local function calls, the performance dynamics are fundamentally divergent: local invocations execute in nanoseconds, whereas remote network hops require microseconds or milliseconds. This latency demands massive concurrency.
Furthermore, the foundational assumption of single-host computing—fate-sharing—disappears. In a single Java virtual machine (JVM), an object does not fail in isolation; if a critical failure occurs, the entire process crashes together. In contrast, the hardest part of building distributed systems centers on handling partial failures, where individual components crash, hang, or lose network connectivity while the rest of the application continues to run. Finally, static configuration files are obsolete. In Amazon's early architecture, engineers knew every physical online host and precisely where the database lived, but dynamic cloud fleets have eliminated that certainty entirely.
[13:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=780s) Five Core Distributed Systems Primitives
To help internal teams navigate these distributed systems hurdles, Amazon initially invested in education, such as the weekly "Principles of Amazon" talk series led by principal engineers and architects. Recognizing that training alone could not solve the problem, the company created managed platform services like Amazon S3, Amazon DynamoDB, Amazon RDS, and Amazon Aurora, alongside deployment and testing tooling like AWS CodeDeploy and fault injection frameworks.
Yet, building the next generation of AWS cloud services still requires lower-level architectural building blocks. The speakers highlight that while many such primitives exist, five core primitives stand out as essential to discuss within the scope of the presentation:
- **Group Membership:** Defining who belongs to a operational set and their respective roles. - **Discovery:** Finding and routing to dynamic members without human intervention. - **Metadata Store:** Maintaining the global truth and configuration state of the system. - **Failure Detection:** Accurately identifying dead or unreachable components in real time. - **Workflows:** Coordinating multi-step distributed operations safely.
[15:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=900s) Group Membership and the Split-Brain Hazard
Group membership governs distributed collaboration. When Amazon S3 receives a `PUT` request, it must immediately determine which specific servers should store the replicas of that object; on a `GET` request, it must look up which active nodes hold that data. In Amazon RDS Multi-AZ deployments, synchronous replication occurs between a primary and a standby node, requiring a consensus on which node is the elected master. Similar requirements govern Amazon ElastiCache clusters. Fundamentally, group membership dictates who is currently in the group, who is excluded, and what specialized roles each member holds.
While this may seem as straightforward as persisting IP endpoints to a file, dynamic environments make it fraught. Consider a three-way replicated data store consisting of replicas A, B, and C accepting client writes:
```mermaid flowchart TD accTitle: Quorum Split and the Split-Brain Dilemma accDescr: How network partitioning causes replica divergence and potential split-brain behavior. subgraph Normal["Majority Quorum"] A["Replica A"] B["Replica B"] A <--> B NewReplica["New Replica C'"] A -.-> NewReplica B -.-> NewReplica end subgraph Partitioned["Isolated Partition"] C["Replica C (Isolated)"] Ghost1["Spawned Node 1"] Ghost2["Spawned Node 2"] C -.-> Ghost1 C -.-> Ghost2 end Clients["Client Requests"] --> Normal Clients -.->|"Split Writes"| Partitioned ```
If node C is severed by a network partition, the remaining nodes A and B still constitute a quorum majority. Nodes A and B can continue serving client traffic seamlessly and spawn a replacement node to restore their durability target of three copies. The critical issue emerges on the isolated side of the partition: - Node C must resolve whether to keep serving local reads or attempt to rebuild its own quorum. - If node C spins up two fresh peers, it establishes an alternate write quorum. - This creates parallel read and write streams, producing split-brain syndrome.
Systems with internal reconciliation engines that tolerate eventual consistency—such as the original Amazon Dynamo design—can recover from divergent branches. However, when building strongly consistent platforms like DynamoDB, naive group membership strategies fail outright. While real-world network failures rarely mimic textbook partitions, subtle protocol mismatches regularly trigger split-brain states in production. Ultimately, any robust group membership mechanism must support three non-negotiable capabilities: 1. Safely adding new members to the active set. 2. Excommunicating degraded, unresponsive, or decommissioned nodes. 3. Enabling reliable, cluster-wide discovery of membership changes and role assignments.
[18:30](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1110s) Discovery in Elastic Environments
Group membership leads directly into the problem of discovery. A booting node—such as a newly provisioned storage server in Amazon S3—must query the environment to determine which cluster or shard it belongs to, just as clients need to resolve the dynamic endpoints of an Amazon RDS Multi-AZ replica set.
Historically, static configuration files have been the default mechanism: “I mean, this is by far the most widely used technique for building discovery. I mean, I'm pretty sure every one of you is still running, because some of my teams still do.” Static configuration operates adequately when cluster membership rarely fluctuates. In an elastic, EC2-driven environment where instances cycle continuously, hardcoded approaches collapse. Every scale-out, hardware replacement, or termination would force a human operator to intervene manually—editing configs, coordinating deployments, and reloading server processes—making manual configuration incompatible with cloud elasticity.
[20:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1200s) The Limitations of DNS for Service Discovery
Historically, DNS was a popular option for service discovery, and it continues to be used in certain areas. DNS was originally conceived with a very straightforward challenge in mind: mapping a human-readable domain name to a single server endpoint so that web browsers and external clients can route traffic to it. Over time, developers began recognizing the utility of this model and wondered why they couldn't overload DNS to discover all the backend servers backing an application by exposing them through a single DNS endpoint. Although this pattern gained universal adoption and seemed to work reasonably well at first glance, it breaks down in distributed systems due to three major limitations:
First, until services like Amazon Route 53 arrived, DNS lacked dynamic programmatic control. A system could not simply invoke an API to declare that an endpoint should no longer direct traffic to five specific cells, but instead distribute requests across three or ten servers. Second, DNS handles rapid membership churn terribly; because changes propagate slowly, it cannot be used to construct rapid, replicated failover mechanisms. Third, and most critically, DNS scales historically through aggressive multi-tiered caching. Resolving records involves six or seven layers of caches: the local host, the JVM, the operating system kernel, platform resolver caches, and ISP recursors. This extensive caching chain makes it exceedingly difficult for applications to react swiftly to cluster topology changes.
[21:28](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1288s) Gossip Protocols: Epidemic Simplicity and Inconsistency Pitfalls
To overcome the static nature of DNS, the Amazon S3 team implemented an alternate discovery mechanism using gossip protocols. This marked one of the very first custom distributed computing primitives built at Amazon. The premise behind gossip—also known as an epidemic protocol—is to use the network itself to discover cluster membership:
```mermaid flowchart TD accTitle: Gossip Protocol Heartbeating Loop accDescr: Diagram showing a node periodically waking up to ping a random peer and updating its local membership table based on inbound messages.
subgraph PeriodicLoop["Periodic Heartbeat Cycle"] A["Node A (Al V.)"] -->|"Wake up every second"| B["Pick random peer"] B -->|"Send: 'Hey, I'm Al V., I'm alive'"| C["Node B (Peer)"] end
subgraph StateUpdate["Membership State Update"] D["Inbound message: 'Hey, I'm Swami'"] --> E["Parse sender identity"] E --> F["Add Swami to local table"] end ```
Every second or so, an individual node wakes up, selects a peer at random from its known membership list, and transmits a brief heartbeat stating that it is alive. Simultaneously, all other nodes perform the exact same routine. Whenever a node processes an inbound ping from a peer announcing its presence, it appends that peer to its local table.
This model is conceptually elegant—the initial implementation was famously coded over a single weekend by an engineer on the S3 team. Yet underneath its mathematical simplicity lies significant complexity. Because it behaves like a viral infection, its convergence properties rely on the mathematics of epidemics. The fundamental flaw is that different cluster members frequently observe divergent, inconsistent views of who currently belongs to the group. As the speaker explains:
> “And I'll tell you that in the early days of AWS and the S3 project in particular, we way underestimated how that could lead to subtle problems and hard things to work out. It's just very hard to deal with the fact that you don't have a consistent view of the group membership.”
This divergence creates identical failure modes to stale DNS caches or desynchronized configuration files. While gossip works well in theory, rationalizing these asynchronous membership views during operational anomalies, such as network partitions, proved to be an immense burden on system builders and operators.
[24:12](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1452s) Modern Bootstrap via Dedicated Metadata Stores
Because handling the edge cases of gossip membership caused massive operational headaches, AWS shifted toward using dedicated metadata or consensus stores—such as Amazon DynamoDB—to manage cluster discovery and bootstrapping. Instead of relying on epidemic dissemination to guess the state of the cluster, instances query a centralized metadata store on startup to retrieve their designated server endpoints.
```mermaid flowchart LR accTitle: Centralized Metadata Discovery Model accDescr: Worker instances query a shared metadata store like DynamoDB during boot to fetch topology, offloading membership consistency.
subgraph ClusterBoot["Bootstrap Nodes"] N1["New Instance 1"] N2["New Instance 2"] end
subgraph Storage["Consensus / Metadata Tier"] DDB[("Metadata Store<br/>(e.g., DynamoDB)")] end
N1 -->|"Query endpoint topology"| DDB N2 -->|"Query endpoint topology"| DDB ```
This pattern offloads the burden of maintaining high availability, fault tolerance, and massive scaling to an external engine purpose-built for that workload. When the speaker jokingly asked the audience why the original S3 architecture didn't simply store its group membership in DynamoDB, the answer was obvious: DynamoDB did not exist yet, with a speaker quipping that he had slacked off by not inventing it earlier.
Today, core AWS services consistently rely on centralized metadata engines for their control planes: - **Amazon RDS**: When a customer executes `CreateDBInstance`, the control plane persists instance definitions—specifying the EC2 tier, storage footprint, and customer ID—so subsequent `DescribeDBInstances` calls retrieve accurate instance topologies. - **Amazon DynamoDB**: Operates an internal metadata management system (effectively running a mini-DynamoDB within DynamoDB) to map individual partition ranges to specific backing server endpoints. - **Amazon ElastiCache**: Tracks cluster configurations, node allocations, and cache endpoints.
When building or using these metadata layers, systems must adhere to three design principles: 1. **Simplicity**: Access paths must be kept minimal and direct. Complex operations like multi-table relational joins during a `DescribeTables` request should be strictly avoided, as joins eventually collapse under heavy operational load. Query-oriented key-value lookups are preferred. 2. **High Availability**: Architectural choices should lean toward high uptime, adopting eventually consistent reads wherever acceptable. 3. **Elastic Scalability**: Because platform metadata grows relentlessly alongside the core data footprint, the storage layer must scale automatically to prevent engineering teams from constantly fighting manual capacity planning exercises.
Teams running on DynamoDB frequently abstract the storage layer behind internal service APIs. This abstraction layer enables developers to mutate schemas on the fly or swap out underlying storage tiers (e.g., fronting components with an internal Redis cache) without imposing disruptive data migrations on downstream clients.
[27:32](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1652s) The Failure Detection Dilemma and "The World's Funniest Joke"
Once group membership is established, the secondary challenge is determining when to evict a degraded node. Eviction fundamentally hinges on failure detection. To illustrate why detecting a dead server is fraught with peril in modern distributed computing, the speaker recounted what was scientifically categorized by researchers as "the funniest joke in the world":
Two hunters are walking out in the woods when one of them suddenly collapses to the ground, his eyes rolled back in his head. Panicking and unsure of what to do, his companion dials 911 on his cell phone and cries out, *"My friend's lying down there. I think he's dead. What do I do?"* The operator attempts to calm him down, responding, *"Hold on, hold on, just calm down first, make sure he's dead."* The call goes dead silent for a brief moment, followed immediately by the loud blast of a gunshot. The hunter picks the phone back up and says, *"OK, now what?"*
The joke captures the essence of failure detection: there is no clean, definitive way to confirm that a remote server or software component has truly perished.
> “If I go way back in time to when I was still young, we had techniques like I/O fencing, where we could use hardware to say, OK, that server-- I want that server no longer to be able to communicate with the rest of my cluster. So I want him fenced off. And now I've shot him. I know he's dead. We can't do that anymore.”
On legacy enterprise systems, operators relied on hardware-level I/O fencing to physically isolate a host from shared storage buses and networks, guaranteeing its termination. In modern commodity cloud hardware architectures, physical fencing is unavailable. Consequently, distributed systems are forced to rely on passive observations: listening across an unreliable network, noting when heartbeats cease, and attempting to infer whether an unresponsive server has actually died or is merely experiencing a transient network hiccup.
[30:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1800s) Failure Detection and the Challenge of "Silence"
The speaker addresses the fundamental difficulty in distributed systems of distinguishing between a failed server and a server that is merely experiencing a network delay. Because there is no way to definitively prove why a server has stopped responding, the system inevitably faces "false positives" where healthy nodes are incorrectly flagged as failed. To manage this, the primary approach is to move away from attempting to detect "failure" directly and instead focus on detecting "liveness" through heartbeat protocols.
Heartbeats provide a way to establish that a communication path exists. The speaker notes that these are used throughout AWS, including the gossip-based protocols (epidemic algorithms) used for S3. If a node stops receiving a heartbeat within its expected group membership table, it concludes that the server has likely failed. The speaker emphasizes a critical design lesson: "Silence in a distributed system is very, very hard to deal with. Because you can't tell the difference between somebody who's just resting and somebody who's failed."
- **Key Lessons for Failure Detection:** - Avoid letting components go silent. - Design protocols that do not rely on perfect failure detection, allowing for "hair-trigger" detection while maintaining correct results. - Prefer **leases** over **locks**. In a distributed system, if a node crashes while holding a lock, resources can become permanently unavailable. Leases enforce a time-bound ownership of a resource, forcing the holder to stop if they cannot complete their work within the allotted duration.
[33:14](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1994s) Implementing Workflows in AWS
The discussion transitions to workflows, which are essential for executing a series of asynchronous actions. The speaker recalls that when building systems like CloudFront or RDS, the initial thought of writing complex workflows felt like "old school" pipe-driven programming. However, the core problem is simple: executing a series of actions asynchronously, one after another. This is the foundation for creating EC2 instances, RDS databases, or DynamoDB tables.
The speaker explains the complexity using the RDS `create DB instance` workflow. This process involves creating EC2 instances across multiple Availability Zones, setting up storage and filesystems, configuring replication, and enabling monitoring—totaling roughly 20 distinct steps before the instance is marked as "available" to the user.
- **Distinction between Sync and Async:** - Not everything needs a workflow. If a task is synchronous and latency-sensitive, avoid modeling it as an asynchronous workflow. - Conversely, long-running processes (like creating an EC2 instance) must be modeled as asynchronous workflows, which is why the initial API call returns "creating" and requires the user to poll for the final status.
[35:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2100s) Decomposing Workflows and the Importance of Idempotency
To manage long-running workflows that might fail at intermediate steps, the team decomposes the process into a series of stateless, independent activities. Each activity performs its work, updates a metadata store (like DynamoDB), and the next activity picks up from the state saved in that store. This allows the system to recover gracefully if a crash occurs.
The speaker highlights **idempotency** as the most critical lesson for building reliable workflows. An activity must be designed so that executing it once or a thousand times yields the same result. Without this, the system cannot safely retry operations after a failure, which compromises overall availability.
- **Key Workflow Strategies:** - Decompose workflows into small, independent activities. - Use a metadata store to keep track of progress. - "Build idempotent activities in your workflow so that you can actually carry to build scalable workflows."
[37:25](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2245s) The Fundamental Problem of Consensus
The speaker concludes that all the primitives discussed—group membership, metadata stores, workflows, and failure detection—ultimately rest upon one common, deep-rooted problem in distributed systems: **consensus**. Whether it is deciding who the primary node is, maintaining a consistent view of data, or managing workflow states, processes must arrive at an agreement on a single authoritative value.
The speaker notes that achieving this agreement in a global environment is one of the most challenging aspects of distributed computing. This problem is solved using the **Paxos protocol**, originally formulated by Leslie Lamport.
- **The Core Problem:** - Consensus involves a distributed set of processes agreeing on a single value, even in the face of network unreliability and individual node failures. - “Agreement in your distributed system really is the fundamental problem.”
[40:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2400s) The Three Kinds of Consistent Distributed Systems
Allan Vermeulen begins by discussing the history of distributed consensus, noting that Leslie Lamport originally stumbled upon the Paxos algorithm while trying to prove that solving the distributed consensus problem was mathematically impossible. This difficulty is what makes consensus such a classic, deep interview problem; it sounds deceptively simple, but it is incredibly hard to solve. Allan explains that over his years of reviewing architectures at Amazon, he has developed a strict rule of thumb for evaluating any system that claims to deliver consistent results. He asserts that every single consistent distributed system can be classified into one of only three categories.
The first category consists of systems that rely on a single point of failure, such as a central database, to act as the sole authoritative source of truth. The second category consists of systems that use Paxos at the very bottom of their stack to reach agreement. The third category, Allan jokes, consists of systems that are simply broken. He points out that even when a service like DynamoDB is used as a metadata store and appears to avoid a single point of failure, drilling down into its architecture reveals Paxos at the bottom of its storage groups to elect masters and maintain consistency.
“And anybody who claims that they have a distributed system that offers consistent results, I'll drill into their system, and I'm always able to classify it into one of three categories.” — Allan Vermeulen
- **Category 1 (Single Point of Failure):** Easy to build and consistent because everyone queries a single authoritative database, but vulnerable to outages. - **Category 2 (Paxos at the Bottom):** Highly resilient systems with no single point of failure, relying on a consensus protocol at the lowest layer. - **Category 3 (Broken):** Systems that claim consistency without a single point of failure or Paxos, but fail under edge cases.
[41:52](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2512s) Operational Realities of Paxos and Fuzzy Protocols
Allan warns developers to beware of "fuzzy protocols" presented during design reviews. He cautions against trusting designs where engineers claim their custom protocol is consistent because they have manually thought through and resolved every possible edge case. At Amazon's massive scale, highly improbable events—such as rare network partitions, simultaneous hardware failures, and bizarre timing anomalies—happen regularly. If a system does not have a single point of failure or Paxos at its core, it will eventually fail when these rare events inevitably occur.
Reflecting on their own experiences, Allan and Swami Sivasubramanian recall writing a Paxos implementation together several years ago. They learned that while the core mathematical protocol is relatively straightforward, the operational scaffolding required to make it production-ready is incredibly difficult. Building a system that performs well, supports seamless software upgrades, and gracefully handles host replacements when hardware fails requires an immense amount of complex engineering.
“So beware of people who go into a design review and say, yeah, I've got the system, and I know it's consistent, because I've worked out all the edge cases, because they haven't.” — Allan Vermeulen
- **Fuzzy Protocols:** Custom, ad-hoc consensus protocols that fail to account for the extreme edge cases encountered at cloud scale. - **Operational Complexity:** The core Paxos algorithm is simple, but managing host failures, software deployments, and performance tuning around it is exceptionally difficult.
[43:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2580s) The Evolution of Consensus: From Libraries to Transactional Journals
To prevent Amazon's internal teams from repeatedly rewriting consensus code, Allan and Swami initially built a shared Paxos library. This library modeled a distributed state machine to help services like Amazon S3 agree on state transitions. However, forcing every developer to integrate this library and reason through Paxos themselves did not scale. To solve this, they shifted their approach and built Paxos as a service, exposing it as a lock and leasing primitive similar to Google's Chubby lock service. This service was widely adopted for locking, leasing, and managing group membership.
Over time, they realized that a locking mechanism is not the ideal abstraction for most distributed systems. Instead, what developers actually need is a transactionally consistent journal that preserves the entire history of state transitions rather than just the current state. This realization led to the development of Amazon's latest internal distributed systems primitive: a highly durable, ACID-compliant transactional journal. This journal now serves as the foundation for several major AWS services, including Amazon Kinesis and the newly announced DynamoDB Streams, which allows developers to pipe a consistent log of database updates directly into AWS Lambda.
```mermaid flowchart TD accTitle: Evolution of Consensus Primitives at Amazon accDescr: A flowchart showing the progression from a Paxos library to a lock service, and finally to a transactional journal. A["Paxos Library\n(Distributed State Machine)"] -->|"Hard to scale\n(Developers must reason through Paxos)"| B["Lock/Lease Service\n(Similar to Google Chubby)"] B -->|"Locking is not the best abstraction"| C["Transactional Journal\n(ACID-compliant log of state transitions)"] C --> D["Amazon Kinesis"] C --> E["DynamoDB Streams"] ```
“Instead, It is all coming down to you want a transactionally consistent journal, which actually preserves the history of state transition, not just the current state.” — Swami Sivasubramanian
- **Paxos Library:** Initially built to help services like Amazon S3 agree on state transitions, but proved too complex for general developer consumption. - **Lock Service:** A centralized leasing and locking service modeled after Google Chubby, used for group membership and coordination. - **Transactional Journal:** An ACID-compliant ledger of state transitions that underpins Amazon Kinesis and DynamoDB Streams.
[45:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2700s) Wrapping Up: We Are All Distributed Systems Developers
Swami and Allan wrap up the session by leaving the audience with three key takeaways. First, they emphasize that distributed systems engineering is no longer a niche academic discipline. Anyone building applications on top of AWS is, by default, a distributed systems developer, whether they have formal training in the subject or not. Second, they urge developers to identify and leverage core distributed systems primitives rather than trying to build custom consensus or storage protocols from scratch.
Finally, they advise developers to abstract away as much of this underlying complexity as possible by using higher-order, fully managed AWS services. Services like Amazon S3, DynamoDB, EC2, Amazon Aurora, AWS Simple Workflow Service (SWF), and Amazon RDS handle the heavy lifting of consensus, replication, and scaling automatically. The speakers close the presentation with a lighthearted apology to the audience and organizers for running slightly over their allotted time.
“Even if you don't know it, each one of you building on top of AWS, you are already becoming a distributed systems developer, whether you like it or not.” — Swami Sivasubramanian
- **Takeaway 1:** Cloud development inherently makes every developer a distributed systems engineer. - **Takeaway 2:** Focus on core primitives and avoid reinventing consensus or transactional logging. - **Takeaway 3:** Use higher-order managed services (S3, DynamoDB, EC2, Aurora, SWF, RDS) to mask distributed systems complexity. - **Closing Note:** The speakers went 1 minute and 15 seconds over their time limit, jokingly noting they were explicitly warned not to do so.
## Notable quotes > [30:00](https://www.youtube.com/watch?v=QVvFVwyElLY&t=1800s) Silence in a distributed system is very, very hard to deal with. Because you can't tell the difference between somebody who's just resting and somebody who's failed. — Allan Vermeulen
> [37:25](https://www.youtube.com/watch?v=QVvFVwyElLY&t=2245s) Agreement in your distributed system really is the fundamental problem. — Allan Vermeulen
> [03:45](https://www.youtube.com/watch?v=QVvFVwyElLY&t=225s) And every app is becoming a distributed app. And every developer is becoming a distributed developer, whether they like it or not. — Swami Sivasubramanian
## Mentioned Al Vee, Allan Vermeulen, Amazon Aurora, Amazon CloudFront, Amazon DynamoDB, Amazon DynamoDB Streams, Amazon EC2, Amazon ElastiCache, Amazon Kinesis, Amazon RDS, Amazon Route 53, Amazon S3, Amazon Simple Workflow Service (SWF), Amazon.com, AWS CodeDeploy, AWS Lambda, Google Chubby, IBM System/370, Leslie Lamport, Paxos protocol, Redis, Skinner vacuum, Swami Sivasubramanian, University of Waterloo
## Video description "AWS and Amazon.com operate some of the world's largest distributed systems infrastructure and applications. In our past 18 years of operating this infrastructure, we have come to realize that building such large distributed systems to meet the durability, reliability, scalability, and performance needs of AWS requires us to build our services using a few common distributed systems primitives. Examples of these primitives include a reliable method to build consensus in a distributed system, reliable and scalable key-value store, infrastructure for a transactional logging system, scalable database query layers using both NoSQL and SQL APIs, and a system for scalable and elastic compute infrastructure. In this session, we discuss some of the solutions that we employ in building these primitives and our lessons in operating these systems. We also cover the history of some of these primitives andndash; DHTs, transactional logging, materialized views and various other deep distributed systems concepts; how their design evolved over time; and how we continue to scale them to AWS. "
[Source](https://www.youtube.com/watch?v=QVvFVwyElLY)