Separate failure domains
Spread instances across workers with anti-affinity and across zones where supported. Reserve capacity for recovery.
RUK-COM / MANAGED DATABASE CLUSTERS
Database clusters for critical enterprise systems. Purposeful replication, failover and recovery, with Ruk-Com expertise from architecture design to real recovery.
HIGHLIGHT / CLOUDNATIVEPG
PostgreSQL on Kubernetes with CloudNativePG
KUBERNETES + CLOUDNATIVEPG
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.
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.
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.
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 ↗
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.
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 →PRODUCTION CHECKLIST
Spread instances across workers with anti-affinity and across zones where supported. Reserve capacity for recovery.
Validate IOPS, latency, WAL headroom and CSI expansion support. Each instance maintains its own data volume.
Async offers flexibility. Synchronous replication and failover quorum involve latency and availability trade-offs.
Apply least privilege and manage secrets and certificates separately from database backups.
Use metrics and logs to track lag, retained WAL, archiving and backups, with actionable alerts and runbooks.
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
Choose an engine and mode. Simulate a failure, role change and rejoin, with separate client, replication and recovery paths.
Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.
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.
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 ↗SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.
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.
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 ↗Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.
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.
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 ↗SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.
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.
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 ↗Clients use two ProxySQL nodes to reach writable database peers. Write-set certification coordinates changes within the component that retains quorum.
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.
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 ↗Clients send SQL through two ProxySQL nodes. Both primaries accept writes and exchange binary logs; extra secondaries serve reads.
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.
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 ↗SQL passes through two ProxySQL nodes. One primary handles writes; secondaries can handle reads. ProxySQL health routing does not provide automatic primary promotion.
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.
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 ↗Clients use two ProxySQL nodes to reach writable database peers. Write-set certification coordinates changes within the component that retains quorum.
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.
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 ↗Clients connect directly to PostgreSQL: writes use the primary and configured read connections use secondaries. There is no proxy or automatic failover manager.
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.
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 ↗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.
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.
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 ↗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.
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.
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 ↗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.
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.
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 ↗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.
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.
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 ↗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.
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.
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 ↗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.
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.
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 ↗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
Replication maintains live copies. Backups provide recovery points before deletion or unwanted changes. Enterprise protection needs both.
Choose asynchronous, streaming or quorum-based replication according to engine, latency, consistency and RPO needs.
Validate the candidate, quorum and former-primary isolation before routing writes. Test client reconnection and retry behavior.
Define retention, recovery points and restore drills. Keep backups separate from the cluster and verify restored data is usable.
Node returns → Check timeline / logs → Catch up or rebuild → Validate readiness → Restore traffic
RUK-COM / DATABASE OPERATIONS
Align service scope and SLA with system criticality, from performance through incident response and recovery planning.
Track query latency, connections, replication lag, slow queries, storage and backup results to identify problems early.
Plan read replicas, connection pools and storage growth for each engine, accounting for IOPS, WAL / binlog and recovery headroom.
Design private connectivity, TLS and role-based privileges, with secrets, patching and audit practices aligned to your policies.
Specialists investigate client connections, queries, proxies, replication and the underlying infrastructure.
Test switchover, failover, restore and rollback before production changes, with reusable runbooks and recorded results.
Agent assistance summarizes anomalies and prioritizes investigation. Access and system changes follow agreed permissions and procedures.
ASSESS / MIGRATE / OPERATE
Review engine, version, size, extensions and RPO / RTO.
Select the topology and rehearse with authorized data.
Validate data, define write freeze and rollback for the migration method.
Hand over runbooks, monitoring, backup and capacity plans.
BEFORE YOU DEPLOY
Yes. Deletion or unwanted changes can replicate to every copy. Maintain separate backups, suitable retention and regular restore tests.
No. Some modes depend on quorum and health detection; others require manual promotion, notably the referenced MySQL-family primary–secondary and standard PostgreSQL modes.
Validate consistency and catch-up first. Recovery may use binlogs, WAL, oplog, IST / SST or a rebuild, depending on the engine and retained history.
Define and test targets for each system based on sync policy, data size, networking, backups and recovery methods before agreeing the SLA.
Provide engine/version, data size, read/write workload, peak connections, extensions, security requirements and a migration window.
YOUR DATA / OUR EXPERTISE
Discuss architecture, migration and managed service scope with Ruk-Com.