replication-patterns

Design database replication topologies with failover and consistency controls.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill replication-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: replication-patterns
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/replication-patterns
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill replication-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design how a distributed database keeps multiple data copies in agreement while meeting availability, recovery, and consistency requirements.

Core Features & Use Cases

  • Replication topology selection: Compare single-leader (primary-replica), multi-leader (multi-primary), and leaderless/quorum approaches.
  • Synchrony trade-offs: Choose synchronous, semi-sync, or asynchronous replication based on latency, RPO, and failure behavior.
  • Read-after-write correctness: Handle stale-read risk using sticky sessions, read-from-leader, monotonic reads, version tokens, or explicit acceptance of staleness.
  • Failover and split-brain prevention: Plan quorum-based promotion and fencing to avoid silent divergence.
  • Design discipline aligned to workloads: Tie replication decisions to CAP/PACELC positioning and operational constraints, while avoiding mismatches like sharding or ACID-level guarantees.

Quick Start

Use the replication-patterns skill to design and justify a concrete replication and failover strategy for a database with one writer region and multiple reader regions, including how clients avoid stale reads immediately after writes.

Frequently Asked Questions about replication-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design database replication that prevents split brain and maintains consistency?

Database replication prevents split brain by applying quorum-based promotion and fencing during failover. You maintain consistency by selecting an appropriate topology like primary-replica or leaderless, combined with synchronous or asynchronous replication tuned to your workload.

What is the best way to avoid stale reads immediately after a write in a multi-region database?

Avoid stale reads after a write by applying read-after-write mitigations such as sticky sessions, reading from the leader, monotonic reads, or version tokens. Choose the strategy that best balances latency against your workload's consistency requirements.

How do I choose between synchronous and asynchronous replication for my database failover strategy?

Choose between synchronous and asynchronous replication by evaluating your latency, recovery point objective (RPO), and failure behavior needs. Synchronous offers stronger consistency, while asynchronous reduces latency but risks data loss during failover.

When should I use a leaderless quorum topology instead of a primary-replica setup?

Use a leaderless quorum topology when you need high write availability and multi-primary conflict tolerance across regions. Choose primary-replica setups when your workload is read-heavy and prefers simpler consistency models with a single write leader.

Can I use multi-primary replication to improve write availability without causing silent data divergence?

Multi-primary replication improves write availability but requires explicit conflict resolution and fencing to prevent silent data divergence. You must design operational practices that monitor replication lag and enforce quorum to keep multi-node data copies consistent.

Why does read-after-write consistency fail with asynchronous replication and how do I fix it?

Read-after-write consistency fails with asynchronous replication because replicas lag behind the primary, causing stale reads. Fix this by routing reads to the leader, using version tokens, or implementing sticky sessions to ensure clients read their own writes.