| description | Use when designing how a database keeps multiple copies of its data in agreement across nodes for availability, read scaling, and disaster recovery: the three foundational topologies (single-leader / primary-replica, multi-leader / multi-primary, leaderless / quorum), synchronous vs asynchronous replication and the replication-lag trade-off, log shipping vs statement replication vs trigger-based replication, the read-after-write consistency problem and its mitigations (sticky session, read-from-leader, monotonic reads), the failover model and split-brain risk, and the relationship to the CAP/PACELC choices the topology realizes. Do NOT use for horizontal partitioning across nodes (use sharding-strategy), the CAP theoretical frame itself (use cap-theorem-tradeoffs), single-node transactional guarantees (use acid-fundamentals), or query tuning (use query-optimization). |
| metadata | {"metadata":"{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"engineering\",\"domain\":\"engineering/data\",\"scope\":\"reference\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-16\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-16\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"comprehension_state\":\"present\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"replication\\\\\\\",\\\\\\\"primary replica\\\\\\\",\\\\\\\"multi-leader\\\\\\\",\\\\\\\"leaderless\\\\\\\",\\\\\\\"quorum\\\\\\\",\\\\\\\"synchronous replication\\\\\\\",\\\\\\\"asynchronous replication\\\\\\\",\\\\\\\"replication lag\\\\\\\",\\\\\\\"read-after-write\\\\\\\",\\\\\\\"failover\\\\\\\",\\\\\\\"split brain\\\\\\\",\\\\\\\"log shipping\\\\\\\",\\\\\\\"WAL streaming\\\\\\\"]\",\"triggers\":\"[\\\\\\\"single-leader vs multi-leader\\\\\\\",\\\\\\\"synchronous vs async replication\\\\\\\",\\\\\\\"what happens on failover\\\\\\\",\\\\\\\"split brain\\\\\\\",\\\\\\\"read-after-write consistency\\\\\\\"]\",\"examples\":\"[\\\\\\\"design replication topology for a service with one region writing and three regions reading\\\\\\\",\\\\\\\"decide between synchronous and asynchronous replication given a target RPO\\\\\\\",\\\\\\\"diagnose stale reads after a write — likely replication lag without read-after-write handling\\\\\\\",\\\\\\\"explain the split-brain risk in multi-leader replication\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"horizontally partition data across nodes (use sharding-strategy)\\\\\\\",\\\\\\\"reason about the CAP theorem abstractly (use cap-theorem-tradeoffs)\\\\\\\",\\\\\\\"explain ACID properties (use acid-fundamentals)\\\\\\\"]\",\"relations\":\"{\\\\\\\"related\\\\\\\":[\\\\\\\"cap-theorem-tradeoffs\\\\\\\",\\\\\\\"acid-fundamentals\\\\\\\",\\\\\\\"sharding-strategy\\\\\\\",\\\\\\\"transaction-isolation\\\\\\\"],\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"cap-theorem-tradeoffs\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"cap-theorem-tradeoffs owns the theoretical frame for the consistency-availability trade-off; this skill owns the operational topologies and protocols that realize a chosen position on that trade-off. The two compose: CAP names the choice; replication-patterns is one of the realizations.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"sharding-strategy\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"sharding-strategy owns horizontal partitioning of data across nodes (different nodes hold different data); this skill owns replication of the same data across nodes (multiple nodes hold the same data). The two often combine in production systems but answer different questions.\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"acid-fundamentals\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"acid-fundamentals owns the single-system transactional model; this skill owns the multi-node replication patterns that distributed systems use to scale, replicate, and survive failure. Replication often relaxes some ACID properties (most notably durability and isolation in async modes).\\\\\\\"}],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"cap-theorem-tradeoffs\\\\\\\",\\\\\\\"sharding-strategy\\\\\\\"]}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"Replication is to a database what mirror copies of a master photograph are to a museum's record — single-leader async is the photographer keeping the negative and printing copies as requested; single-leader sync is the conservator requiring two darkroom signatures before any print leaves the building; multi-leader is multiple authorized photographers in different cities each accepting submissions and reconciling at intervals; leaderless quorum is asking three of five archivists to vote on whether this print matches the master, accepting their verdict. Failover is replacing the negative-keeper when they retire; split brain is what happens when the agency forgets to revoke the old keeper's keys.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Replication is the discipline of keeping multiple copies of the same data on multiple nodes so that the system can serve reads from any copy, survive the failure of any node, or both. The three foundational topologies are single-leader (primary-replica; one node accepts writes, others receive a stream of changes), multi-leader (multi-primary; multiple nodes accept writes and reconcile), and leaderless (quorum; clients write to a quorum of nodes directly). Each topology has its own consistency, availability, con…","skill_graph_source_repo":"https://github.com/jacob-balslev/skill-graph","skill_graph_protocol":"Skill Metadata Protocol v4","skill_graph_project":"Skill Graph","skill_graph_canonical_skill":"skills/replication-patterns/SKILL.md"} |