Library / Case Studies
Salesforce Architecture - How they Handle 1.3 Billion Transactions a Day - High Scalability -
This is a guest post written by Claude Johnson , a Lead Site Reliability Engineer at salesforce...
By High Scalability engineers · High Scalability · Added 2026-10-12
All content belongs to High Scalability engineers / High Scalability. We only link to it and give credit. Report a problem
Learn this case study
About 37 min left. Your work is saved as you go.
What you are about to study
High Scalability explains a real system. It assumes you are comfortable with distributed systems.
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 Salesforce Architecture - How they Handle 1.3 Billion Transactions a Day - High Scalability -.
Warm upGet the vocabulary first.
Courses
Google SRE Book
Free online book on running reliable production systems at Google scale.
GoogleAdvanced
Courses
MIT 6.824: Distributed Systems
Free university course on fault tolerance, replication and consensus with Go labs.
MITAdvanced
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.
Papers · Read here
Bigtable: A Distributed Storage System for Structured Data (paper)
Google's wide-column store: tablets split by key range, a commit log plus sorted files on disk, and the design later copied by HBase and Cassandra.
GoogleAdvanced
Papers · Read here
Consistent Hashing and Random Trees (paper)
The original consistent-hashing paper, written for distributing web caches.
MITAdvanced
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Flannel: An Application-Level Edge Cache to Make Slack Scale
Why Slack put a cache close to users to avoid loading all workspace data at startup, and how it keeps it fresh.
SlackAdvanced
Case Studies · Read here
GRIT: Protocol for Distributed Transactions across Microservices at eBay
eBay technologists recently showed off a distributed transaction protocol called GRIT, for distributed ACID (atomicity, consistency, isolation, durability) transactions across microservices with multiple underlying da...
eBayAdvanced
Read the codeSee how it looks when it is real.
GitHub
Awesome Distributed Systems
A curated list of distributed-systems papers, books, talks and courses.
GitHubAdvanced
GitHub
Papers We Love (repository)
A large, organised collection of computer-science papers by topic.
GitHubAdvanced
Keep learning
Loading community…