RUK-COM / MANAGED DATABASE CLUSTERS

Keep data moving.
Keep business running.

Database clusters for critical enterprise systems. Purposeful replication, failover and recovery, with Ruk-Com expertise from architecture design to real recovery.

HA + Recovery Expert Support SQL · NoSQL · K8s

HIGHLIGHT / CLOUDNATIVEPG

PostgreSQL on Kubernetes with CloudNativePG

CNCF CloudNativePG CNCF Sandbox Project Explore architecture & simulate failover
8 Database engines
16 Cluster architectures
4 Interactive lifecycle states
K8s CloudNativePG solution
+

KUBERNETES + CLOUDNATIVEPG

PostgreSQL on Kubernetes.
Designed for production.

Our recommended approach for teams managing PostgreSQL through the Kubernetes API. CloudNativePG handles cluster lifecycle, streaming replication and failover while keeping the PostgreSQL data path clear.

CLUSTER / ARCHITECTURE LAB
Show paths

Kubernetes + CloudNativePG

PostgreSQL on Kubernetes with distinct write/read services and WAL replication. The operator manages lifecycle and failover; optional PgBouncer pools connections, while dedicated PVCs, backups and PITR have separate roles.

Architecture simulation
Application Choose Read / Write endpoint
Ready
Kubernetes API Cluster CRD · primary Lease
Ready
PgBouncer Pooler Optional · HA connection pool
Ready
CloudNativePG Operator Reconcile · health · roles
Ready
cluster-rw Service → current Primary
Ready
cluster-ro Service → Ready replicas
Ready
Primary · Pod 1 Worker A · Read / Write
Ready
Replica A · Pod 2 Worker B · Read-only
Ready
Replica B · Pod 3 Worker C · Read-only
Ready
PVC 1 Dedicated persistent volume
Ready
PVC 2 Dedicated persistent volume
Ready
PVC 3 Dedicated persistent volume
Ready
Barman Cloud sidecar Inside Primary Pod · logical detail
Ready
Object Storage Base backups + WAL archive
Ready
New recovery cluster PITR workflow · on demand
Ready
Write request Read result Replication Monitor / Control Recovery / Sync PVC attachment

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Writes use PgBouncer → cluster-rw → primary. Replica read results return through cluster-ro. The primary streams WAL directly to replicas, and each Pod has its own PVC.

Architecture details and reference

Optional PgBouncer sits before cluster-rw. cluster-ro selects replicas; cluster-r (not drawn) allows reads from every instance. Operator/API form the control plane, not a SQL path. PITR creates a separate new cluster rather than performing failover. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Barman is shown separately as a logical stage for readability; it runs as a sidecar inside the current primary Pod selected as backup source in this example, not on a separate backup server.

Source documentation ↗
Connections in this state
  • ApplicationPgBouncer Pooler · Write request
  • PgBouncer Poolercluster-rw · Write request
  • cluster-rwPrimary · Pod 1 · Write request
  • Primary · Pod 1cluster-rw · Read result
  • cluster-rwPgBouncer Pooler · Read result
  • PgBouncer PoolerApplication · Read result
  • cluster-roApplication · Read result
  • CloudNativePG OperatorKubernetes API · Reconcile Cluster / Lease
  • CloudNativePG Operatorcluster-rw · Follow elected primary
  • CloudNativePG Operatorcluster-ro · Ready replica membership
  • Replica A · Pod 2cluster-ro · Read result
  • Primary · Pod 1Replica A · Pod 2 · WAL streaming
  • Replica B · Pod 3cluster-ro · Read result
  • Primary · Pod 1Replica B · Pod 3 · WAL streaming
  • Primary · Pod 1PVC 1 · Dedicated PVC mount
  • Replica A · Pod 2PVC 2 · Dedicated PVC mount
  • Replica B · Pod 3PVC 3 · Dedicated PVC mount
  • Primary · Pod 1Barman Cloud sidecar · Base backup / WAL source
  • Barman Cloud sidecarObject Storage · Backup + WAL archive
  • Object StorageNew recovery cluster · PITR · restore into new cluster

The operator manages.
SQL flows to the database.

Clients write through cluster-rw and read replicas through cluster-ro. cluster-r reads across all ready instances. Choose an endpoint for your freshness needs; add PgBouncer when connection pooling is required.

Backup + WAL.
Recover into a new cluster.

Use the Barman Cloud plugin for base backups and WAL archiving to object storage. Perform PITR into a new cluster and validate the data before moving clients.

Connect to Ruk-Com Object Storage →
01 Select recovery point 02 Restore base backup 03 Replay WAL 04 Validate new cluster

PRODUCTION CHECKLIST

Best practices for PostgreSQL on K8s

Separate failure domains

Spread instances across workers with anti-affinity and across zones where supported. Reserve capacity for recovery.

A PVC for every instance

Validate IOPS, latency, WAL headroom and CSI expansion support. Each instance maintains its own data volume.

Match sync policy to RPO

Async offers flexibility. Synchronous replication and failover quorum involve latency and availability trade-offs.

TLS + NetworkPolicy

Apply least privilege and manage secrets and certificates separately from database backups.

Monitor WAL and backups

Use metrics and logs to track lag, retained WAL, archiving and backups, with actionable alerts and runbooks.

Rehearse before production

Test switchover, restoration and reconnection. Set resource requests and PDBs; PDBs do not prevent hardware failures.

PITR requires a usable base backup, continuous WAL to the target, and accessible credentials and keys. A sync policy is not a universal zero-data-loss guarantee.

CHOOSE YOUR DATABASE

Different engines. Different paths to resilience.

Choose an engine and mode. Simulate a failure, role change and rejoin, with separate client, replication and recovery paths.

MySQL

MariaDB

Percona

PostgreSQL

MongoDB

Redis

Couchbase

OpenSearch

CLUSTER / ARCHITECTURE LAB
Show paths

MySQL Primary–Primary

Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary 1 Read / Write
Ready
Primary 2 Read / Write
Ready
Extra Replica 1 Read-only
Ready
Extra Replica 2 Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Both existing primaries serve writes; ProxySQL routes reads and writes while binary logs replicate.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary 1 · Write request
  • Primary 1ProxySQL 1 · Read result
  • ProxySQL 1Primary 2 · Write request
  • Extra Replica 1ProxySQL 1 · Read result
  • ProxySQL 2Primary 1 · Write request
  • ProxySQL 2Primary 2 · Write request
  • Primary 2ProxySQL 2 · Read result
  • Extra Replica 2ProxySQL 2 · Read result
  • Primary 1Primary 2 · Binlog
  • Primary 2Primary 1 · Binlog
  • Primary 1Extra Replica 1 · Binlog
  • Primary 2Extra Replica 2 · Binlog

MySQL Primary–Secondary

SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary Read / Write
Ready
Secondary Read-only
Ready
Extra Replica Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

One primary handles writes and asynchronously replicates binary logs to the secondaries. ProxySQL distributes read traffic.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary · Write request
  • PrimaryProxySQL 1 · Read result
  • Extra ReplicaProxySQL 1 · Read result
  • ProxySQL 2Primary · Write request
  • SecondaryProxySQL 2 · Read result
  • PrimarySecondary · Binlog
  • PrimaryExtra Replica · Binlog

MariaDB Primary–Primary

Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary 1 Read / Write
Ready
Primary 2 Read / Write
Ready
Extra Replica 1 Read-only
Ready
Extra Replica 2 Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Both existing primaries serve writes; ProxySQL routes reads and writes while binary logs replicate.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary 1 · Write request
  • Primary 1ProxySQL 1 · Read result
  • ProxySQL 1Primary 2 · Write request
  • Extra Replica 1ProxySQL 1 · Read result
  • ProxySQL 2Primary 1 · Write request
  • ProxySQL 2Primary 2 · Write request
  • Primary 2ProxySQL 2 · Read result
  • Extra Replica 2ProxySQL 2 · Read result
  • Primary 1Primary 2 · Binlog
  • Primary 2Primary 1 · Binlog
  • Primary 1Extra Replica 1 · Binlog
  • Primary 2Extra Replica 2 · Binlog

MariaDB Primary–Secondary

SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary Read / Write
Ready
Secondary Read-only
Ready
Extra Replica Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

One primary handles writes and asynchronously replicates binary logs to the secondaries. ProxySQL distributes read traffic.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary · Write request
  • PrimaryProxySQL 1 · Read result
  • Extra ReplicaProxySQL 1 · Read result
  • ProxySQL 2Primary · Write request
  • SecondaryProxySQL 2 · Read result
  • PrimarySecondary · Binlog
  • PrimaryExtra Replica · Binlog

MariaDB Galera

Clients use two ProxySQL nodes to reach writable database peers. Write-set certification coordinates changes within the component that retains quorum.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary 1 Certified write sets
Ready
Primary 2 Certified write sets
Ready
Primary 3 Certified write sets
Ready
Primary 4 Certified write sets
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

All four illustrated members participate, including the optional extra peer. Write sets replicate among writable peers.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools. Replication lanes represent group writeset exchange, not chained replication.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary 1 · Write request
  • Primary 1ProxySQL 1 · Read result
  • ProxySQL 1Primary 2 · Write request
  • ProxySQL 1Primary 3 · Write request
  • Primary 3ProxySQL 1 · Read result
  • ProxySQL 1Primary 4 · Write request
  • ProxySQL 2Primary 1 · Write request
  • ProxySQL 2Primary 2 · Write request
  • Primary 2ProxySQL 2 · Read result
  • ProxySQL 2Primary 3 · Write request
  • ProxySQL 2Primary 4 · Write request
  • Primary 4ProxySQL 2 · Read result
  • Primary 1Primary 2 · Group writesets
  • Primary 2Primary 1 · Group writesets
  • Primary 2Primary 3 · Group writesets
  • Primary 3Primary 2 · Group writesets
  • Primary 3Primary 4 · Group writesets
  • Primary 4Primary 3 · Group writesets

Percona Primary–Primary

Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary 1 Read / Write
Ready
Primary 2 Read / Write
Ready
Extra Replica 1 Read-only
Ready
Extra Replica 2 Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Both existing primaries serve writes; ProxySQL routes reads and writes while binary logs replicate.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary 1 · Write request
  • Primary 1ProxySQL 1 · Read result
  • ProxySQL 1Primary 2 · Write request
  • Extra Replica 1ProxySQL 1 · Read result
  • ProxySQL 2Primary 1 · Write request
  • ProxySQL 2Primary 2 · Write request
  • Primary 2ProxySQL 2 · Read result
  • Extra Replica 2ProxySQL 2 · Read result
  • Primary 1Primary 2 · Binlog
  • Primary 2Primary 1 · Binlog
  • Primary 1Extra Replica 1 · Binlog
  • Primary 2Extra Replica 2 · Binlog

Percona Primary–Secondary

SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary Read / Write
Ready
Secondary Read-only
Ready
Extra Replica Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

One primary handles writes and asynchronously replicates binary logs to the secondaries. ProxySQL distributes read traffic.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary · Write request
  • PrimaryProxySQL 1 · Read result
  • Extra ReplicaProxySQL 1 · Read result
  • ProxySQL 2Primary · Write request
  • SecondaryProxySQL 2 · Read result
  • PrimarySecondary · Binlog
  • PrimaryExtra Replica · Binlog

Percona XtraDB

Clients use two ProxySQL nodes to reach writable database peers. Write-set certification coordinates changes within the component that retains quorum.

Architecture simulation
Database Client Read / Write
Ready
ProxySQL 1 Query routing
Ready
ProxySQL 2 Query routing
Ready
Primary 1 Certified write sets
Ready
Primary 2 Certified write sets
Ready
Primary 3 Certified write sets
Ready
Primary 4 Certified write sets
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

All four illustrated members participate, including the optional extra peer. Write sets replicate among writable peers.

Architecture details and reference

Two default ProxySQL nodes. Dashed extra nodes are active in this expanded example; illustrated counts are not deployment minima. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control. Read lanes are representative; both proxies share the same role-based backend pools. Replication lanes represent group writeset exchange, not chained replication.

Source documentation ↗
Connections in this state
  • Database ClientProxySQL 1 · Write request
  • ProxySQL 1Database Client · Read result
  • Database ClientProxySQL 2 · Write request
  • ProxySQL 2Database Client · Read result
  • ProxySQL 1Primary 1 · Write request
  • Primary 1ProxySQL 1 · Read result
  • ProxySQL 1Primary 2 · Write request
  • ProxySQL 1Primary 3 · Write request
  • Primary 3ProxySQL 1 · Read result
  • ProxySQL 1Primary 4 · Write request
  • ProxySQL 2Primary 1 · Write request
  • ProxySQL 2Primary 2 · Write request
  • Primary 2ProxySQL 2 · Read result
  • ProxySQL 2Primary 3 · Write request
  • ProxySQL 2Primary 4 · Write request
  • Primary 4ProxySQL 2 · Read result
  • Primary 1Primary 2 · Group writesets
  • Primary 2Primary 1 · Group writesets
  • Primary 2Primary 3 · Group writesets
  • Primary 3Primary 2 · Group writesets
  • Primary 3Primary 4 · Group writesets
  • Primary 4Primary 3 · Group writesets

PostgreSQL Standard

Clients connect directly to PostgreSQL: writes use the primary and configured read connections use secondaries. There is no proxy or automatic failover manager.

Architecture simulation
Database Client Read / Write
Ready
Primary Read / Write
Ready
Secondary Read-only
Ready
Extra Replica Read-only
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

The primary asynchronously streams WAL to its secondaries. Queries follow node roles; dashed members are enabled expansion examples.

Architecture details and reference

One primary, one secondary and one optional extra secondary. Dashed expansion nodes are enabled in this example. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • Database ClientPrimary · Write request
  • PrimaryDatabase Client · Read result
  • SecondaryDatabase Client · Read result
  • Extra ReplicaDatabase Client · Read result
  • PrimarySecondary · WAL
  • PrimaryExtra Replica · WAL

PostgreSQL + Pgpool-II

Clients use the active Pgpool-II, coordinated with standby proxies through Watchdog. Writes reach the primary; secondaries serve reads. Pgpool-II monitors database health and manages failover.

Architecture simulation
Database Client Read / Write
Ready
Pgpool Active Read / Write routing
Ready
Pgpool Standby Watchdog
Ready
Pgpool Standby Watchdog
Ready
Primary Read / Write
Ready
Secondary Read-only
Ready
Extra Replica Read-only
Ready
Write request Read result Replication Monitor / Control Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

The primary asynchronously streams WAL to its secondaries. Queries follow node roles; dashed members are enabled expansion examples.

Architecture details and reference

One active and two optional standby Pgpool-II nodes, plus three illustrated database members. WAL replication is asynchronous; this is not Patroni. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • Database ClientPgpool Active · Write request
  • Pgpool ActiveDatabase Client · Read result
  • Pgpool ActivePgpool Standby · Watchdog
  • Pgpool StandbyPgpool Active · Watchdog
  • Pgpool ActivePgpool Standby · Watchdog
  • Pgpool StandbyPgpool Active · Watchdog
  • Pgpool ActivePrimary · Write request
  • PrimaryPgpool Active · Read result
  • SecondaryPgpool Active · Read result
  • Extra ReplicaPgpool Active · Read result
  • PrimarySecondary · WAL
  • PrimaryExtra Replica · WAL
  • Pgpool ActivePrimary · Monitor / role check
  • Pgpool ActiveSecondary · Monitor / role check
  • Pgpool ActiveExtra Replica · Monitor / role check

PostgreSQL HA · Patroni + HAProxy

HAProxy separates primary write and replica read endpoints, with optional per-node PgBouncer pools. Patroni coordinates roles through an etcd quorum; PostgreSQL streams WAL directly between database nodes.

Architecture simulation
Application Read / Write endpoints
Ready
HAProxy / Cloud LB Role-aware SQL routing
Ready
PgBouncer 1 Optional connection pool
Ready
PgBouncer 2 Optional connection pool
Ready
PgBouncer 3 Optional connection pool
Ready
PgBouncer 4 Optional connection pool
Ready
Replica · Node 1 PostgreSQL + Patroni
Ready
Primary · Node 2 PostgreSQL + Patroni
Ready
Replica · Node 3 PostgreSQL + Patroni
Ready
Extra Replica PostgreSQL + Patroni
Ready
etcd 1 DCS · quorum member
Ready
etcd 2 DCS · quorum member
Ready
etcd 3 DCS · quorum member
Ready
Write request Read result Replication Monitor / Control Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Writes follow the leader lock to Node 2; replicas serve read results. PgBouncer pools connections while WAL streams directly from primary to replicas.

Architecture details and reference

Three PostgreSQL nodes plus an optional scale-out replica, with three etcd members. PgBouncer and VIP are optional. HAProxy checks Patroni roles; etcd carries no SQL or WAL. This is separate from CloudNativePG. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • ApplicationHAProxy / Cloud LB · Write request
  • HAProxy / Cloud LBApplication · Read result
  • HAProxy / Cloud LBPgBouncer 2 · Write request
  • PgBouncer 2Primary · Node 2 · Write request
  • Primary · Node 2PgBouncer 2 · Read result
  • PgBouncer 2HAProxy / Cloud LB · Read result
  • Replica · Node 1PgBouncer 1 · Read result
  • PgBouncer 1HAProxy / Cloud LB · Read result
  • Primary · Node 2Replica · Node 1 · WAL streaming
  • Replica · Node 3PgBouncer 3 · Read result
  • PgBouncer 3HAProxy / Cloud LB · Read result
  • Primary · Node 2Replica · Node 3 · WAL streaming
  • Extra ReplicaPgBouncer 4 · Read result
  • PgBouncer 4HAProxy / Cloud LB · Read result
  • Primary · Node 2Extra Replica · WAL streaming
  • HAProxy / Cloud LBPrimary · Node 2 · /primary health
  • Primary · Node 2etcd 2 · Patroni · leader / member state
  • HAProxy / Cloud LBReplica · Node 1 · /replica?lag health
  • Replica · Node 1etcd 1 · Patroni · leader / member state
  • HAProxy / Cloud LBReplica · Node 3 · /replica?lag health
  • Replica · Node 3etcd 3 · Patroni · leader / member state
  • HAProxy / Cloud LBExtra Replica · /replica?lag health
  • Extra Replicaetcd 3 · Patroni · leader / member state
  • etcd 1etcd 2 · Raft quorum
  • etcd 2etcd 3 · Raft quorum

MongoDB Replica Set

The driver discovers replica-set members and sends writes to the primary. Reads use the primary by default or secondaries according to read preference. No separate proxy is required.

Architecture simulation
MongoDB Driver Replica-set discovery
Ready
Primary Writes
Ready
Secondary 1 Oplog replica
Ready
Secondary 2 Oplog replica
Ready
Write request Read result Replication Monitor / Control Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

The primary records writes in the oplog; secondaries replicate asynchronously. The driver selects destinations by role and read preference.

Architecture details and reference

Three data-bearing members. Elections require a voting majority; election timing is not an SLA, and secondary reads may lag. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • MongoDB DriverPrimary · Write request
  • PrimaryMongoDB Driver · Read result
  • Secondary 1MongoDB Driver · Read result · secondaryPreferred
  • Secondary 2MongoDB Driver · Read result · secondaryPreferred
  • PrimarySecondary 1 · Oplog
  • PrimarySecondary 2 · Oplog
  • Secondary 1Secondary 2 · Heartbeat / voting

Redis Cluster

A cluster-aware client sends commands directly to the primary owning each hash slot. Each primary has one replica. This topology has no proxy or Sentinel.

Architecture simulation
Cluster Client Hash-slot routing
Ready
Primary 1 Shard 1
Ready
Replica 1 Shard 1 copy
Ready
Primary 2 Shard 2
Ready
Replica 2 Shard 2 copy
Ready
Primary 3 Shard 3
Ready
Replica 3 Shard 3 copy
Ready
Write request Read result Replication Monitor / Control Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Three shards divide the hash slots. Each primary handles its slots and asynchronously replicates to its paired replica.

Architecture details and reference

Three primaries and three replicas: six nodes. Scaling adds pairs and reshards; asynchronous replication can lose some writes during failover. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • Cluster ClientPrimary 1 · Write request
  • Primary 1Cluster Client · Read result
  • Primary 1Replica 1 · Async replication
  • Cluster ClientPrimary 2 · Write request
  • Primary 2Cluster Client · Read result
  • Primary 2Replica 2 · Async replication
  • Cluster ClientPrimary 3 · Write request
  • Primary 3Cluster Client · Read result
  • Primary 3Replica 3 · Async replication

Couchbase Cluster

The SDK routes directly using the vBucket map. Nodes hold active and replica vBuckets. Scaling redistributes data through rebalance; there is no separate query proxy.

Architecture simulation
Couchbase SDK vBucket routing
Ready
Couchbase 1 Active + replica vBuckets
Ready
Couchbase 2 Active + replica vBuckets
Ready
Couchbase 3 Active + replica vBuckets
Ready
Couchbase 4 Active + replica vBuckets
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

The SDK follows the vBucket map; replica partitions live on other members. Arrows illustrate partition placement, not full-database copies on every node.

Architecture details and reference

The source illustrates two solid and two dashed nodes to show expansion, not a two-node deployment baseline. The package defaults to three; this example activates all four. Configure replicas and failover appropriately. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • Couchbase SDKCouchbase 1 · Write request
  • Couchbase 1Couchbase SDK · Read result
  • Couchbase SDKCouchbase 2 · Write request
  • Couchbase 2Couchbase SDK · Read result
  • Couchbase SDKCouchbase 3 · Write request
  • Couchbase 3Couchbase SDK · Read result
  • Couchbase SDKCouchbase 4 · Write request
  • Couchbase 4Couchbase SDK · Read result
  • Couchbase 1Couchbase 2 · vBuckets
  • Couchbase 2Couchbase 3 · vBuckets
  • Couchbase 3Couchbase 4 · vBuckets
  • Couchbase 4Couchbase 1 · vBuckets

OpenSearch Cluster

Beats sends data through Logstash into OpenSearch; Dashboards queries and visualizes it. This example expands OpenSearch into three nodes to explain shard recovery, not a package minimum.

Architecture simulation
Beats Data shippers
Ready
Logstash Transform / ingest
Ready
Dashboards Search / visualize
Ready
OpenSearch 1 Shard A primary
Ready
OpenSearch 2 Shard A replica
Ready
OpenSearch 3 Other shards
Ready
Write request Read result Replication Recovery / Sync

Write shows requests entering the database. Read shows results returning to clients; SELECT requests travel in the opposite direction.

Logstash ingests and Dashboards searches. Shard A has a primary on node 1 and replica on node 2; node 3 holds other shards.

Architecture details and reference

Reference flow: Beats → Logstash → OpenSearch ← Dashboards. Logstash and Dashboards are optional. Shard A placement is illustrative, not a global database writer. Red carries write requests into the database; green carries read results back to the client (SELECT requests travel in the opposite direction). Amber is replication; dashed blue is monitoring/control.

Source documentation ↗
Connections in this state
  • BeatsLogstash · Ingest events
  • LogstashOpenSearch 1 · Index documents
  • LogstashOpenSearch 3 · Index documents
  • OpenSearch 1Dashboards · Search result
  • OpenSearch 2Dashboards · Search result
  • OpenSearch 3Dashboards · Search result
  • OpenSearch 1OpenSearch 2 · Shard A replica

Automatic failover depends on topology, quorum and configuration. MySQL / MariaDB / Percona primary–secondary and standard PostgreSQL require operator-led promotion and routing changes.

AVAILABILITY + RECOVERABILITY

Protect availability.
Prepare for recovery.

Replication maintains live copies. Backups provide recovery points before deletion or unwanted changes. Enterprise protection needs both.

Replication matched to workload

Choose asynchronous, streaming or quorum-based replication according to engine, latency, consistency and RPO needs.

Failover with clear conditions

Validate the candidate, quorum and former-primary isolation before routing writes. Test client reconnection and retry behavior.

Recovery you can validate

Define retention, recovery points and restore drills. Keep backups separate from the cluster and verify restored data is usable.

REJOIN ≠ READY

Node returns → Check timeline / logs → Catch up or rebuild → Validate readiness → Restore traffic

RUK-COM / DATABASE OPERATIONS

Beyond cluster deployment.
Expertise across the data lifecycle.

Align service scope and SLA with system criticality, from performance through incident response and recovery planning.

Performance & observability

Track query latency, connections, replication lag, slow queries, storage and backup results to identify problems early.

Capacity & scaling

Plan read replicas, connection pools and storage growth for each engine, accounting for IOPS, WAL / binlog and recovery headroom.

Security by design

Design private connectivity, TLS and role-based privileges, with secrets, patching and audit practices aligned to your policies.

Expert incident support

Specialists investigate client connections, queries, proxies, replication and the underlying infrastructure.

Maintenance & recovery drills

Test switchover, failover, restore and rollback before production changes, with reusable runbooks and recorded results.

Ruk-Com Agent + specialists

Agent assistance summarizes anomalies and prioritizes investigation. Access and system changes follow agreed permissions and procedures.

ASSESS / MIGRATE / OPERATE

A planned migration.
A clear operating model.

01

Assess

Review engine, version, size, extensions and RPO / RTO.

DELIVERABLE Scope & system targets
02

Design & rehearse

Select the topology and rehearse with authorized data.

DELIVERABLE Architecture & test plan
03

Sync & cutover

Validate data, define write freeze and rollback for the migration method.

DELIVERABLE Validation & rollback plan
04

Operate & improve

Hand over runbooks, monitoring, backup and capacity plans.

DELIVERABLE Runbook & operations plan

BEFORE YOU DEPLOY

Before you deploy
a database cluster.

Do I still need backups with HA?

Yes. Deletion or unwanted changes can replicate to every copy. Maintain separate backups, suitable retention and regular restore tests.

Does every mode promote a primary automatically?

No. Some modes depend on quorum and health detection; others require manual promotion, notably the referenced MySQL-family primary–secondary and standard PostgreSQL modes.

Can a rejoining node serve traffic immediately?

Validate consistency and catch-up first. Recovery may use binlogs, WAL, oplog, IST / SST or a rebuild, depending on the engine and retained history.

What RPO / RTO can I expect?

Define and test targets for each system based on sync policy, data size, networking, backups and recovery methods before agreeing the SLA.

What should I prepare?

Provide engine/version, data size, read/write workload, peak connections, extensions, security requirements and a migration window.

YOUR DATA / OUR EXPERTISE

Start with your critical data.
Build the right cluster together.

Discuss architecture, migration and managed service scope with Ruk-Com.

Discuss your database solution