What New Problems Appear When You Split One Machine Into Many
When a single machine runs out of capacity, spreading compute and data across more servers is a natural way to scale. Commodity machines can be added incrementally, failures have a chance of staying localized, and you aren’t permanently tied to expensive vertical hardware with hard ceilings.
Going distributed doesn’t remove complexity, though. It just moves where that complexity shows up. Everything an in-process function call, a local disk, and a single shared clock used to guarantee implicitly now has to be rebuilt over the network: services have to find each other, data has to be sharded and replicated, nodes have to guess whether remote peers are still alive, and everyone has to agree on event ordering and final outcomes.
Why teams turn to horizontal scaling once a single machine hits its ceiling
Distributed systems didn’t start because Moore’s Law slowed down, but flattening single-core gains, growing data volumes, and cheaper commodity servers definitely made horizontal scaling the default move. Compared with constantly upgrading to a bigger box, adding ordinary servers lets you scale in smaller steps and spread replicas across machines, or even data centers, to limit the impact of single points of failure.
Beyond compute and storage capacity, splitting a system can also buy deployment isolation and clearer team boundaries. Different services can ship on independent schedules, and hot components can scale on their own. Those wins have strings attached: service boundaries have to make sense, deployment automation and observability have to keep up, and the overhead of cross-node communication can’t eat all the gains you split for.
That’s why “distributed is always cheaper, faster, and easier to iterate on” doesn’t hold. More nodes mean more network hops, more data copies, more failure combinations, and more moving parts to operate. At smaller scale, a single machine or a simpler centralized design is often far more economical. Splitting only pays for its coordination cost once capacity, availability, geography, or organizational boundaries become real constraints.
Once services are split, every call first has to figure out “where to go”
Calling a function inside a monolith never requires knowing what address it lives at. Once services are deployed independently, a caller first has to translate a logical service name into a list of reachable instances, then pick a specific IP and port. Service registration/discovery and load balancing handle those two steps together.
1 | Logical service name |
When a service boots up, it registers its address with a registry and reports health through heartbeats, leases, or a controller. Callers can query on demand or subscribe to instance changes and cache them locally. A registry doesn’t store much data; the tricky part is that state churns constantly, and the discovery path itself must not easily turn into a single point of failure for business traffic.
People often emphasize availability here, yet “a service registry only needs to be AP” is an oversimplification. Stale instance lists route traffic to dead nodes, and conflicting registration states mess up routing too. In practice, teams usually enforce clear consistency rules on registration writes and mutations, while letting callers fall back to their last known good local cache during brief control-plane hiccups. How fast you evict unhealthy instances, how often you tolerate false positives, and how long you keep caches valid all have to be balanced together.
When a remote call fails, you may never know why on the spot
On a single machine, a function either returns or throws an error. When a network call times out, all the caller knows for sure is that no response arrived in time: the request might never have reached the server, the server might have crashed halfway through, or the work might have succeeded while the reply vanished on the way back. Partial failure, where some nodes break while others keep running, is the most common failure mode in distributed systems.
Timeouts and retries handle plenty of transient glitches, but retries manufacture duplicate requests. If a payment already went through and the client retries because the response was lost, missing idempotency protection means charging twice. Stable request IDs, result records, and idempotent handling have to be designed alongside retries from the start.
Retries also need guardrails. Retrying immediately in a tight loop piles extra load onto a struggling downstream service, and many callers retrying in lockstep can trigger a fresh traffic spike. Standard practice is to cap attempt counts and total wait time, add exponential backoff with jitter, and budget retries across the whole call chain rather than letting every layer retry blindly on its own.
When a downstream service stays unhealthy, fast circuit breaking cuts wasted waiting, graceful degradation gives callers an acceptable fallback response, and rate limiting protects the system from traffic beyond its capacity. Auto-scaling helps with sustained load growth, but metrics collection, scheduling, and instance startup all take time, so it cannot replace timeouts, isolation, and overload protection.
When data outgrows one machine, sharding is only step one
Once data exceeds a single machine’s storage or throughput limit, the first decision is which shard owns each record. Hash sharding spreads keys evenly across nodes and fits point lookups well; range sharding keeps adjacent keys together and works better for range scans. Neither is set-and-forget: adding or removing nodes requires data migration, and skewed access patterns still create hot shards.
Sharding solves capacity and parallelism, not node failure. If a record lives on only one node, that node going down makes the data unavailable, so you need replication too. Replicas improve fault tolerance and let you spread reads across machines, but from that moment on, the system has to answer harder questions: how many replicas must acknowledge a write, which replicas are allowed to serve reads, and who wins when two nodes accept concurrent updates.
1 | Data outgrows one box → Sharding → Migration, hot shards, cross-shard operations |
Copying bytes to another machine is the easy part. Keeping all replicas agreed on the same version under failures and concurrent writes is the hard part. Leader-based replication lets a single primary order all writes, at the cost of handling primary failures and failover. Leaderless replication avoids a single leader dependency, but requires Quorums, versioning, or conflict merging. Which model makes sense depends on your read/write pattern and how long an inconsistency window the business can live with.
Every machine has a clock, yet there is no shared timeline
Physical clocks on different machines drift apart, and clock synchronization only bounds that error within some window. Two log timestamps a few milliseconds apart cannot reliably prove the causal order of two remote events, and a backward clock jump can even make a later event look earlier.
When you need to express causality, logical clocks step in. Lamport’s happened-before relation treats “event A precedes B in the same process” and “sending a message precedes receiving it” as establishable order; events with no message chain between them may be concurrent, and you don’t force an artificial order using local wall clocks. Logical clocks solve ordering, though they tell you nothing about real-world wall-clock time.
Spanner shows another path. TrueTime uses GPS receivers and atomic clocks to expose a time interval with bounded uncertainty. Spanner uses those bounds to assign transaction commit timestamps and waits out the uncertainty window when needed to provide external consistency. Here the clock machinery is for transaction ordering and consistency, not for “generating distributed transaction IDs.”
A distributed ID only needs to be unique within its required scope; typical designs combine a timestamp, node ID, and local sequence number. An ID can be roughly ordered, yet it doesn’t automatically grant transaction atomicity, nor does it prove that two causally unrelated events ought to execute in ID order.
When multiple nodes modify shared state, coordination is unavoidable
A distributed lock looks like a local mutex moved onto the network, until you have to deal with crashed holders, expiring leases, and old holders waking back up. “Auto-release on timeout” isn’t enough on its own: an old node can resume after a long pause and keep writing even after a new node has acquired the same lock. The standard defense is issuing a monotonically increasing fencing token on each lock grant, so the underlying storage resource rejects writes carrying stale tokens.
Transactions spanning multiple resources need coordination too. 2PC asks participants whether they can commit and then broadcasts a single commit or abort decision so everyone lands on the same result. Still, if participants are already in the Prepared state when the coordinator becomes unreachable, they may have to wait until recovery information comes back. 3PC, coordinators backed by high-availability logs, and consensus-replicated commit protocols all shrink that window of uncertainty under different failure assumptions.
Consensus handles another basic problem: when nodes see different messages and failures, how do they still agree on a single value, a leader, or a log sequence? It supports leader election, configuration changes, and replicated logs, at the cost of majorities, terms, durable logging, and crash recovery. Service discovery, distributed transactions, and consensus are related, but you can’t swap one protocol name in for another.
CAP is about the choice forced by a partition
In CAP, consistency means linearizability, availability means every request to a non-failing node eventually gets a response, and partition tolerance means the system keeps running under arbitrary message loss between nodes. The constraint it states is concrete: once a network partition occurs, two disconnected sides cannot simultaneously guarantee linearizability and keep processing every request successfully.
Real systems can’t guarantee a flawless network, so P isn’t an option you can switch off. Operations that preserve consistency during a partition have to reject or stall requests on any side that cannot verify the latest state. If both sides keep accepting traffic, you must accept temporary divergence and detect and merge conflicts once the network heals. A system can also make different choices for different data and operations, without stamping a single CP or AP label across an entire product.
That explains the trade-off in service registration and discovery too. Discovery usually prioritizes still finding healthy instances during faults, though stale or wrong routes carry their own cost; permissions, configuration, or leader state often demand stronger consistency. Design decisions come down to comparing the cost of a stale read against the cost of a rejected request.
ACID and BASE aren’t direct stand-ins for CAP camps either. ACID describes the atomicity, consistency, isolation, and durability properties of transactions; BASE is a set of design patterns leaning toward basic availability, soft state, and eventual consistency. Relational databases can be deployed with varying consistency and availability models, and NoSQL stores can offer linearizable reads or full transactions. Picking a storage engine still comes back to what guarantees each specific operation actually needs.
After splitting, old limits turn into a set of coordination problems
| Problem encountered | Common mechanisms | Costs that come with them |
|---|---|---|
| Callers don’t know instance addresses | Service registry/discovery, load balancing, local cache | Stale state, false health positives, control-plane dependency |
| Downstream slows down or partially fails | Timeouts, idempotent retries, backoff, circuit breaking, degradation, rate limiting | Duplicate requests, false trips, rejected traffic |
| One machine can’t hold all the data | Hash or range sharding | Data migration, hot shards, cross-shard operations |
| Reads must survive node failures | Multi-replica setups, primary-replica or Quorums | Replication lag, conflicts, leader failover |
| Need to determine event ordering | Logical clocks, bounded-uncertainty physical clocks | Only captures specific orderings; must handle clock uncertainty |
| Multiple nodes must reach the same decision | Transaction protocols, leases, consensus | Extra messaging, durable logs, blocking or majority requirements |
Before adopting a distributed architecture, write down the exact bottleneck a single machine is hitting and which states genuinely require strong consistency during a failure. Once you start building, request IDs and idempotency, timeouts and retry budgets, shard migration, data recovery, clock skew, and failure drills should all be explicit design choices rather than whatever defaults a framework happens to ship with.
Distributed systems let you break past single-machine limits and put data and compute where they belong. The trade-off is straightforward: any remote call may end without a clear answer, and any replicated piece of data may temporarily hold multiple versions. Whether the system stays stable depends on whether those uncertain states are recognized, recorded, and built into your recovery path.