Library / Blogs
Cloud Big Data Design Patterns - Lynn Langit
A real-world engineering write-up from Lynnlangit on designing Large-Scale Systems.
By Lynnlangit engineers · Lynnlangit · Added 2026-10-12
All content belongs to Lynnlangit engineers / Lynnlangit. We only link to it and give credit. Report a problem
Learn this article
About 37 min left. Your work is saved as you go.
What you are about to study
Lynnlangit wrote this to explain how they thought about a problem. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Advanced Distributed Systems · 15 minA map of distributed-system patternsThirty recurring building blocks (logs, quorums, leases, clocks, partitions, heartbeats and more) grouped by the problem each solves, so you can name them in a design.Read here
Why a pattern map
Real distributed systems (Kafka, etcd, Cassandra, Kubernetes and others) are assembled from a small set of recurring solutions. Knowing their names lets you read documentation faster, discuss designs precisely and spot what a design is missing. This lesson groups thirty well-known patterns by the problem they solve. Each is explained in a sentence or two; the catalogue linked below gives full treatment. Many have their own lessons on this site (consensus, storage engines, Kafka, Redis).
100%Figure SDA-ADS-09-1 · Problems and the pattern families that solve them · © forcsguy.com
1. Durability and ordering
- Write-ahead log: record every change durably before applying it, so a crash can be recovered by replaying (see the storage engines lesson).
- Segmented log: split the log into segment files so old data can be deleted or compacted cheaply and lookups stay fast (Kafka does this).
- Low-water mark: the oldest log position still needed; everything before it can be discarded.
- High-water mark: the newest position known to be safely replicated; readers must not go beyond it.
- Replicated log: a log kept identical on several nodes, usually driven by a leader; the basis of consensus-backed systems.
2. Replication and agreement
- Leader and followers: one node orders writes; others copy and can serve reads.
- Majority quorum: act only when more than half of the nodes agree, so any two decisions overlap.
- Paxos: a protocol that makes a majority agree on a value despite failures (see the consensus lesson; Raft is its more understandable cousin).
- Consistent core: a small strongly consistent cluster (the "core") makes decisions for a much larger, weakly coupled cluster, such as metadata and leadership.
- Two-phase commit: a coordinator asks all participants to prepare, then to commit; gives atomicity across nodes but blocks if the coordinator fails, so use sparingly.
- Follower reads: allow reads from followers to spread load, accepting some staleness (or bounding it).
- Emergent leader: nodes agree on a leader from membership data (for example the oldest member) without a separate vote.
3. Failure handling and authority
- Heartbeat: periodic "I am alive" messages; absence signals failure.
- Gossip dissemination: nodes pass information to random peers, so news (membership, failure) spreads exponentially without a central point (used by Cassandra and Dynamo-style stores).
- Lease: a time-bound right (to be leader or hold a lock) that expires automatically unless renewed.
- Generation clock (also called epoch or term): a number increased at each leadership change and sent with requests; receivers ignore lower numbers, stopping a stale leader.
- Idempotent receiver: handle repeated requests safely by remembering what was already processed.
- State watch: clients subscribe to changes of a key or range and are notified, instead of polling (etcd and ZooKeeper watches).
4. Time and versions
- Lamport clock: a logical counter that orders events consistently with causality without synchronised wall clocks.
- Version vector: per-node counters that detect whether two copies are ordered or concurrent (conflict); see the clocks lesson.
- Hybrid clock: combines physical time with a logical counter so timestamps are close to real time yet still ordered.
- Clock-bound wait: wait out the clock uncertainty before committing, so timestamps reflect real order (used by globally consistent databases with bounded-error clocks).
- Versioned value: store each update as a new version so reads can be consistent snapshots and conflicts can be detected.
5. Partitioning
- Fixed partitions: split data into a fixed number of partitions up front and move whole partitions between nodes when scaling (like Redis hash slots or Kafka partitions).
- Key-range partitions: split by sorted ranges of keys, good for range scans; ranges split as they grow (like Bigtable and HBase), at the risk of hot ranges.
6. Performance and concurrency
- Request batch: group several requests into one network call or one disk write to amortise cost.
- Request pipeline: send further requests without waiting for earlier responses, keeping the link busy.
- Request waiting list: park a request until the cluster has replied or an event happens, then answer the client.
- Singular update queue: funnel all updates through one thread and queue to avoid locks and keep order (the idea behind single-threaded cores in Redis and exchanges).
- Single-socket channel: one connection per peer, with ordered messages, to preserve order and reduce overhead.
Seeing the patterns in a system
System Patterns visible Kafka Segmented log, replicated log, leader and followers, high-water mark, fixed partitions, request batch, heartbeats etcd or ZooKeeper Replicated log with majority quorum, leader election, state watch, leases, generation clock Cassandra Gossip, fixed or token partitions, version-based conflict resolution, write-ahead log, tunable quorum reads A global SQL database Consensus per partition, key-range partitions, hybrid or bounded clocks, two-phase commit across partitions Redis Cluster Fixed partitions (16,384 slots), leader and followers, gossip, singular update queue How to use this in an interview
When you propose "a leader", immediately address: how it is elected, how a stale leader is fenced (generation clock or lease), how failure is detected (heartbeat) and how followers catch up (replicated log, high-water mark). Naming these shows you know what a one-word box hides.
Real-world reading
Related reading
- In Search of an Understandable Consensus Algorithm (Raft paper)Ongaro and Ousterhout · Stanford UniversityPapers
- Spanner: Google's Globally Distributed Database (paper)Corbett et al. · GooglePapers
- ZippyDB: Facebook's key-value storeMeta Engineering · MetaCase Studies
- The Raft Consensus Algorithm (site and visualisation)Diego Ongaro and community · raft.github.ioDocumentation
Show 6 moreShow fewer
- Time, Clocks, and the Ordering of Events in a Distributed System (paper)Leslie Lamport · Microsoft ResearchPapers
- Patterns of Distributed SystemsUnmesh Joshi · Martin FowlerBlogs
- ZooKeeper: Wait-free Coordination for Internet-scale Systems (paper)Hunt et al. · Yahoo! ResearchPapers
- How Ringpop from Uber Engineering Helps Distribute Your ApplicationUber Engineering · UberCase Studies
- Architecture to Handle 80K RPS Celebrity Sales at Shopify - Simon Eskildsen, Engineering Lead at ShopifyShopifyYouTube
- Building a scalable ELK stack at EnvatoEnvato engineers · EnvatoCase Studies
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Cloud Big Data Design Patterns - Lynn Langit.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Aroma: Using ML for Code Recommendation at Facebook
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains…
FacebookIntermediate
Case Studies · Read here
Brooklin: Distributed Service for Near Real-Time Data Streaming at LinkedIn
Brooklin—a distributed service for streaming data in near real-time and at scale—has been running in production at LinkedIn since 2016, powering thousands of data streams and over 2 trillion messages per day. Today, w...
LinkedInIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…