Inkdown
Start writing

Study

70 filesยท12 subfolders

Shared Workspace

Study
AI eng

08-replication-ha

Shared from "Study" on Inkdown

08 - Replication & High Availability

Why Replication?

Replication serves multiple purposes:

  1. High Availability: If primary fails, replica takes over
  2. Read Scaling: Distribute read load across replicas
  3. Disaster Recovery: Geographic redundancy
  4. Backups: Run backups without impacting primary
  5. Analytics: Run reports on replica, not production

Types of Replication

1. Physical (Binary) Replication

Replicates the exact disk blocks from primary to replica.

Plain text
basic-ques
core
Revision w/ Whiteboard
CN Basics - 1
CN Basics - 2
DNS
Event loop
programming-language-concepts.md
zero-language-explanation.md
DB
Quick
databases-deep-dive.md
01-introduction.md
02-relational-databases.md
03-database-design.md
04-indexing.md
05-transactions-acid.md
06-nosql-databases.md
07-query-optimization.md
08-replication-ha.md
09-sharding-partitioning.md
10-caching-strategies.md
11-cap-theorem.md
12-connection-pooling.md
13-backup-recovery.md
14-monitoring.md
15-database-selection.md
README.md
JS
core topics
Event loop
Merlin Backend
01-Orchestration.md
02-DeepResearch.md
03-Search.md
04-Scraping.md
05-Streaming.md
06-MultiProviderLLM.md
07-MemoryAndContext.md
08-ErrorHandling.md
09-RateLimiting.md
10-TaskQueue.md
11-SecurityAndAuth.md
Orchestration-2nd-draft
Mobile
Build Alternative
Bundling
metro-bundler-deep-dive.md
OpenAI Agents Python
00_OVERVIEW.md
01_AGENT_SYSTEM.md
02_RUNNER_SYSTEM.md
03_TOOL_SYSTEM.md
04_ITEMS_SYSTEM.md
05_GUARDRAILS.md
06_HANDOFFS.md
07_MEMORY_SESSIONS.md
08_MODEL_PROVIDERS.md
09_SANDBOX_SYSTEM.md
10_TRACING.md
11_RUN_STATE.md
12_CONTEXT.md
13_LIFECYCLE_HOOKS.md
14_CONFIGURATION.md
15_ERROR_HANDLING.md
16_STREAMING.md
17_EXTENSIONS.md
18_MCP_INTEGRATION.md
19_BEST_PRACTICES.md
20_ARCHITECTURE_PATTERNS.md
opencode-study
context-handling
core
Python
Alembic
Basics
sqlalchemy - fastapi
SQLAlchemy overview
tweets
system_design_for_agentic_apps.md
Agent Loop

PostgreSQL Streaming Replication Setup:

Bash
2. Logical Replication

Replicates changes at the SQL level (INSERT, UPDATE, DELETE).

Plain text

PostgreSQL Logical Replication:

Sql
3. Statement-Based Replication (MySQL)
Sql

Replication Topologies

1. Primary-Replica (Single Primary)
Plain text
2. Multi-Primary (Multi-Master)
Plain text
3. Cascading Replication
Plain text
4. Ring Topology
Plain text

High Availability (HA)

Measuring Availability
Plain text
Failover Strategies
Manual Failover
Bash
Automatic Failover with Patroni
YAML
Connection Handling During Failover
Plain text
Synchronous vs Asynchronous Replication
Plain text

PostgreSQL Configuration:

Ini

Replication Lag Monitoring

Sql

Common HA Architectures

1. Cloud Managed (AWS RDS, GCP Cloud SQL, Azure)
Plain text
2. Self-Managed with Patroni + etcd
Plain text

Split-Brain Problem

Plain text

Next: Sharding & Partitioning