Picture two services that each handle 10,000 requests per second. The first serves a social feed, where about 99 of every 100 requests are reads. The second records balance changes in a payment ledger, where almost every request is a write that has to keep an invariant intact. On a capacity dashboard they look the same. Architecturally they are close to opposites, and an architecture that works well for one tends to break the other.
That is why the distinction between read-heavy vs write-heavy workloads matters more than raw throughput. Requests per second tell you how much work arrives. They don't tell you what kind of work it is, where the state behind it has to live, or how much staleness each operation can tolerate.
The underlying principle is simple and has wide consequences. You scale reads by copying state. You scale writes by splitting authority over state. Replication, caching, partitioning, indexing, and asynchronous processing are all ways of making one of those two moves, and each one buys capacity at the cost of consistency, coordination, or operational complexity.
This article shows how to analyze a workload's access patterns and turn that analysis into architectural decisions, along with the failure modes that appear when the analysis is wrong.
The Core Problem: Reads and Writes Have Different Physics
Every request either observes state or changes it. That asymmetry is the root of every decision in this article.
A read can be served by any copy of the data that is fresh enough for the caller. That is a large set: a primary database, a replica, a cache, a CDN edge, or a materialized view built hours ago. A write has a much smaller set of valid destinations. It must reach whichever component has authority over that piece of state, because that component is where invariants such as "balance never goes negative" or "username is unique" are enforced.
So reads parallelize naturally, and writes serialize naturally. Any architecture that ignores this ends up fighting it.
The ratio is not one number
"Our system is 90% reads" is a starting point, not an analysis. A useful workload analysis breaks the ratio down along several dimensions:
- Per entity. A user profile may be read 1,000 times per update, while that user's session record is written on every request.
- Per key distribution. A uniform 100:1 ratio behaves very differently from one where 1% of keys get 80% of the traffic.
- Per read shape. Point lookups, range scans, aggregates, and full-text queries put very different loads on the storage layer.
- Per consistency requirement. A read used to render a like count can be minutes stale. A read used to authorize a withdrawal cannot be stale at all.
- Physical vs logical writes. One logical write can become many physical writes: one per secondary index, one per replica, plus write-ahead log entries and compaction rewrites.
That last point is often missed. A table with six secondary indexes and a replication factor of three turns one insert into a lot of disk and network work. A system that looks read-heavy at the API layer can be write-bound at the storage layer.
What happens when the assumption breaks
Take a read-heavy product catalog behind a cache with a 95% hit rate. The database is sized for the 5% of reads that miss. Now a deploy flushes the cache, or a popular key expires while many requests are reading it.
The causal chain looks like this:
cache miss storm
→ 20x normal read volume reaches the database
→ connection pool saturates
→ query latency rises, requests queue
→ upstream timeouts fire
→ clients retry
→ more misses, more queued queries
→ cache cannot repopulate because the database is too slow to answer
The system did not fail because of high traffic. It failed because its capacity plan depended on a hit rate it could not guarantee. The read/write ratio set the architecture, and the architecture quietly turned a cache-hit-rate assumption into a correctness dependency.
Distributed Systems Deep Dive: How Each Mechanism Trades Consistency for Capacity
Replication: scaling reads by copying state
Mental model: replication turns one authoritative copy into many readable copies.
In single-leader replication, all writes go to a leader, and followers apply the leader's change log asynchronously. Read capacity grows roughly linearly with the number of followers, which is why replication is the first tool for read-heavy systems.
What it costs is replication lag. A follower is a view of the past. When lag is small, users rarely notice. When lag grows, during a write burst or a slow follower or a long-running transaction, specific guarantees start to break:
- Read-your-writes: a user updates their profile, refreshes, and sees the old version because the read went to a lagging follower.
- Monotonic reads: two consecutive requests hit different followers, and the user sees data move backward in time.
Neither problem is solved by adding replicas. The usual fixes are routing reads that follow a user's own write to the leader for a short window, pinning a session to one replica, or tracking a replication position (such as a log sequence number) and reading only from replicas that have caught up to it.
Replication does nothing for write throughput. Every follower has to apply every write, so adding replicas adds total write work across the cluster. In a write-heavy system, replicas can fall behind at exactly the moment you depend on them most.
Leaderless systems make the tradeoff adjustable. With N replicas, write quorum W, and read quorum R, choosing R + W > N ensures every read set overlaps the most recent successful write set. That overlap is a necessary condition for reading the latest write, but it is not enough to guarantee linearizability by itself. Sloppy quorums, concurrent writes, and failed partial writes all need extra mechanisms such as read repair and conflict resolution. A read-heavy system can pick a small R and a large W. A write-heavy system can pick the reverse.
Caching: a second representation of state
Mental model: a cache is a replica with no replication protocol. Your application code is the protocol.
Caching works for read-heavy workloads because of a simple formula. The read load that reaches the database equals total reads multiplied by (1 − hit rate). This formula is unforgiving near the top. Going from a 99% hit rate to a 98% hit rate doubles database read load. Hit rate is not a tuning metric; it is a capacity dependency.
The hard part is invalidation. With cache-aside, a common race goes like this:
- Reader A misses and reads value v1 from the database.
- Writer B updates the row to v2 and deletes the cache key.
- Reader A writes v1 into the cache.
The cache now holds stale data indefinitely. TTLs bound how long the inconsistency lasts. Versioned writes or delete-after-delay patterns narrow the race window. Nothing removes it entirely without coordination.
Hot-key expiry needs its own protection. Request coalescing makes sure only one caller rebuilds a missing key while the others wait for that result:
var group singleflight.Group // golang.org/x/sync/singleflight
func GetProduct(ctx context.Context, id string) (*Product, error) {
if p, ok := cache.Get(id); ok {
return p, nil
}
// Concurrent misses for the same key share one database call.
v, err, _ := group.Do(id, func() (interface{}, error) {
p, err := db.LoadProduct(ctx, id)
if err != nil {
return nil, err
}
cache.Set(id, p, jitteredTTL(5*time.Minute))
return p, nil
})
if err != nil {
return nil, err
}
return v.(*Product), nil
}
Two details matter. Coalescing turns N concurrent database reads into one. Jittered TTLs keep keys populated together from expiring together. Both treat the cache's failure behavior as part of the design, not something to tune later.
For write-heavy data, caching often hurts. If a key changes on almost every request, the cache spends its effort on invalidation, hit rates fall, and the system now maintains two copies of state without the benefit.
Partitioning: scaling writes by splitting authority
Mental model: if one node cannot accept every write, give each node authority over a subset of keys.
Partitioning (sharding) is the main tool for write-heavy workloads, because it is the only one that increases the number of places writes can go. Each partition has its own leader, its own log, and its own throughput ceiling.
The new complexity lives at the boundaries between partitions:
- Hot keys. Partitioning spreads keys, not load. One celebrity account or one popular product can saturate a single partition while the rest sit idle. More partitions do not help, because the bottleneck is serialized on one key.
- Cross-partition operations. A transfer between two accounts on different shards needs a distributed transaction, a saga, or a data model that avoids the cross-shard write in the first place.
- Scatter-gather reads. Queries that do not include the partition key have to go to every partition. Tail latency then becomes the latency of the slowest shard.
- Rebalancing. Adding capacity means moving data while it is being written, which is one of the most operationally risky things a storage system does.
The partition key is the most consequential decision in a write-heavy design. It should match the unit of consistency (the set of data that must change together) and the dominant read path at the same time. When those two conflict, one of them needs a secondary representation.
Indexing and storage engines: choosing where to pay
Mental model: an index is a precomputed answer to a read, paid for on every write.
Each secondary index speeds up some reads and slows down every write to that table. In read-heavy systems that is usually a good trade. In write-heavy systems, unused or redundant indexes are a direct tax on throughput and on replication lag.
The same trade appears in storage engines. B-tree engines update pages in place. Reads are predictable, but writes cause random I/O and page splits. Log-structured merge (LSM) engines buffer writes in memory and flush them as immutable sorted files, which makes writes sequential and cheap. The cost moves to reads, which may check several files (bloom filters reduce this), and to background compaction, which rewrites data repeatedly. Under heavy write load, compaction can fall behind, read amplification grows, and latency degrades gradually rather than failing outright.
Neither engine is better in general. The choice depends on whether you would rather pay at write time or at read time, which is exactly what workload analysis tells you.
Enjoying this so far?
Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.
No spam. Unsubscribe anytime.
Architecture: Two Systems, Two Access Patterns
A read-heavy social feed
Consider a hypothetical feed service where reads greatly outnumber posts and users accept seconds of staleness. The key decision is when to do the work of assembling a feed.
Fan-out on write pushes each new post into every follower's precomputed timeline when it is published. Reads become a single cheap lookup. Fan-out on read stores posts once and assembles the timeline when it is requested. Writes are cheap and reads are expensive.
For most accounts, fan-out on write fits the access pattern: one write, many cheap reads. For an account with tens of millions of followers, a single post turns into tens of millions of timeline writes, which is a write storm caused by one request. The usual answer is a hybrid: fan out on write for ordinary accounts, and merge posts from high-follower accounts at read time.
Client
|
v
API Service ----------------------------> Timeline Cache (per-user, precomputed)
| ^
| publish post | merge high-follower posts at read time
v |
Posts Store (partitioned by author_id) ------+
|
v
Event Stream (post_created)
|
v
Fan-out Workers --> write post_id into each follower's timeline
State ownership is clear. The posts store is authoritative. Timelines are derived, disposable, and rebuildable. The consistency boundary is the event stream: a timeline lags behind the posts store by however long fan-out takes, and that lag is a product decision as well as an engineering one.
Under failure, the system degrades gracefully. If fan-out workers fall behind, feeds go stale but stay available. If the timeline cache is lost, it can be rebuilt from the posts store, slowly. The design spends write amplification to buy cheap reads, and keeps that amplification asynchronous so it never blocks the publish path.
A write-heavy transactional service
Now take a hypothetical payment ledger. Writes dominate, every write protects an invariant, and stale reads can cause real financial errors.
Client
|
v
API Service (idempotency key required)
|
v
Ledger DB (partitioned by account_id, single leader per partition)
| [ledger entry + outbox row in one local transaction]
v
Outbox Relay --> Event Stream --> Notifications, analytics, read models
Every choice here follows from the access pattern. Partitioning by account keeps each balance invariant inside one partition's local transaction. Idempotency keys make client retries safe, which matters because a write that times out may have committed anyway. The transactional outbox writes the ledger entry and its event atomically, so downstream consumers can process changes asynchronously without dual-write inconsistency.
Reads that need correctness, such as an authorization check, go to the partition leader. Reads that tolerate staleness, such as statement history, go to asynchronously built read models. This is CQRS (command query responsibility segregation) driven by need rather than fashion: one representation for writes, separate ones for different read paths, with the event stream as the boundary between them.
Tradeoffs and Decision Framework
| Mechanism | Primarily helps | Moves cost to | Breaks down when |
|---|---|---|---|
| Read replicas | Read throughput | Replication lag, read-your-writes logic | Write volume causes lag to grow without bound |
| Caching | Read latency and DB offload | Invalidation, a second copy of state | Hit rate falls, or hot keys expire together |
| Partitioning | Write throughput | Routing, cross-shard operations, rebalancing | Load concentrates on hot keys |
| Secondary indexes | Read query flexibility | Write latency, storage, replication volume | Write rate is high and indexes are rarely used |
| LSM storage | Write throughput | Read amplification, compaction | Compaction cannot keep up with ingest |
| Fan-out on write | Read latency | Write amplification, async lag | Follower counts are highly skewed |
| Async processing | Request-path latency | Eventual consistency, queue lag, retries | Consumers fall behind for longer than staleness tolerance |
A useful decision framework is a short set of questions asked per access path rather than per system:
- What is the ratio for this entity, and how skewed is the key distribution? Skew often matters more than the average.
- How stale can this specific read be? Answer in units of time. "Eventually" is not a requirement.
- What invariant does this write protect, and which data must change atomically to protect it? That set defines your partition key and your transaction boundary.
- Which costs can move off the request path? Work that can happen later should usually happen later, provided the lag is observable and bounded.
- What is the physical write cost of one logical write? Count the indexes, replicas, and derived views.
The answers often point toward a simpler architecture than expected. A single well-indexed relational primary with a couple of replicas comfortably serves many read-heavy products. Introducing sharding, CQRS, or event streams before the workload needs them adds coordination cost with no matching benefit.
Failure Modes and What Happens at Scale
The illustrative numbers below show how behavior changes as load grows. They are not benchmarks.
At around 10 requests per second, almost any design works. A single database handles reads and writes, caching is optional, and the main risks are ordinary bugs. Adding distributed machinery here mostly adds failure modes.
At around 1,000 requests per second, the read/write ratio starts to shape the design. Read-heavy systems add a cache and replicas, and the first stale-read bugs show up as users not seeing their own updates. Write-heavy systems start to feel index cost and lock contention on hot rows.
At around 100,000 requests per second, failures come from interactions between components rather than from a single component:
- Cache stampedes send multiplied read load to a database sized for the miss rate.
- Replication lag spirals: write bursts slow followers, more reads fall back to the leader, the leader slows down, and lag grows.
- Hot partitions saturate while aggregate capacity looks healthy, so dashboards that average across shards hide the problem.
- Retry storms on write paths create duplicate operations unless every write is idempotent.
- Consumer lag in async pipelines turns into user-visible staleness, then into reprocessing backlogs after recovery.
- Reordered events produce incorrect derived state when consumers assume ordering that the stream only guarantees per partition.
The common thread is that each mechanism added to handle load introduces a new state representation, and every representation can diverge, lag, or be overwhelmed independently of the others.
Engineering Principles for Workload-Driven Architecture
Reads scale by copying; writes scale by splitting. Before choosing a technology, decide which of these two moves the access path needs.
Hit rate is a capacity dependency, not a performance metric. If the database cannot survive the cache disappearing, the cache is part of the system's availability model and has to be designed as one.
Every derived copy of state needs an owner, a freshness bound, and a rebuild path. Caches, replicas, and read models without these become sources of silent inconsistency.
Analyze access patterns per path, not per system. One service can contain a read-heavy profile path and a write-heavy session path, and treating them the same compromises both.
Count physical writes, not logical ones. Indexes, replicas, and fan-out multiply each write, and the storage layer only sees the multiplied number.
Partition along the boundary of your invariants. If data must change atomically, keep it on one partition, or accept the coordination cost explicitly.
Asynchronous processing moves cost across time; it does not remove it. Lag needs to be measured, bounded, and tied to what the product promises users.
Final Thoughts
Analyzing read-heavy vs write-heavy workloads is really an exercise in deciding where each cost is paid. Every architecture pays for its reads and writes somewhere: at write time or read time, synchronously or later, on one node or spread across many, with strong guarantees or with staleness that has a bound. Good architectures make those payments on purpose and in places the product can tolerate.
The mechanisms covered here are all well known. The engineering judgment is in matching them to an access pattern that has been measured, broken down by entity and path, and checked against the invariants the system has to protect. That analysis also shows when to stop: a system whose workload doesn't need sharding or event streams is better without them.
These problems sit at the center of the work PulseSoft cares about: understanding where state lives, how it is copied and divided, and what happens when the assumptions between components stop being true. Access patterns are one of the most reliable places to begin that reasoning.
Key Takeaways
- Throughput alone says little about architecture; the read/write ratio, key skew, read shape, and per-read staleness tolerance together determine the right design.
- Read replicas increase read capacity but add no write capacity, and the replication lag they introduce breaks read-your-writes and monotonic-read guarantees unless routing accounts for it.
- Database load behind a cache scales with the miss rate, so a drop from 99% to 98% hit rate doubles database reads, which makes stampede protection and jittered TTLs requirements rather than optimizations.
- Partitioning is the main way to scale writes, but it spreads keys rather than load, so hot keys and cross-partition operations become the new bottlenecks.
- Every secondary index and replica multiplies the physical cost of a logical write, which is why systems that look read-heavy at the API can be write-bound at the storage layer.
- Fan-out on write trades write amplification for cheap reads, and skewed follower distributions usually call for a hybrid that merges high-fanout content at read time.
- Asynchronous processing and CQRS move work off the request path at the cost of eventual consistency, so consumer lag has to be observable and bounded by what the product can tolerate.
Get insights like this in your inbox
Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.
No spam. Unsubscribe anytime.