CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 3 of 5 · 2 min read

Matching a topology to a requirement

The right choice depends on what the system cannot afford to sacrifice: write simplicity, write availability, or absolute write availability.

Think of choosing between a single checkout line, several checkout lines that occasionally need a supervisor to resolve a dispute, or letting any cashier ring up any customer. In the last case, disputes get sorted out afterward.

In plain words: a system that can tolerate writes briefly failing during a leader outage, and that does not need writers in different locations to get low write latency, is well served by single-leader replication's simplicity. A system with writers genuinely spread across distant locations, where waiting for one far-away leader on every write would be too slow, is better served by multi-leader replication, accepting the added complexity of conflict resolution. A system that must remain writable even when a significant fraction of its nodes are unreachable, such as during a network partition, is better served by leaderless replication's quorum-based approach, accepting that reads may occasionally miss the most recent write depending on the chosen quorum sizes.

A worked example. A company's internal admin tool, used by one team in one office, fits single-leader well, since write availability during a brief leader failover matters less than simplicity. A global social media platform with users posting from every continent may lean multi-leader or leaderless, since waiting on a single distant leader for every post would frustrate users everywhere except near that leader.

The key lines. No new SQL; matching a topology to a requirement happens during architecture and infrastructure planning, before any schema or query is written.

Availability-consistency trade-off (in replication)

The availability-consistency trade-off in replication is the general pattern that increasing how many nodes can accept writes, or lowering how many nodes must agree before an operation succeeds, tends to increase write availability while increasing the risk of conflicting or temporarily inconsistent data.

Example: moving from one checkout line to several, then to any available cashier, increases how fast customers get served but increases how often two cashiers' actions need to be reconciled afterward.