Kamal PostgreSQL replication demo

Served by solo · container 51.15.241.168-96e544cd832f

Write a ping

The form posts over Turbo, so nothing here reloads. The panel below refreshes itself once a second: write a ping and watch it cross to the standby.

Try an accidental write during a GET — the thing that breaks the day you turn replicas on. It raises even while you are pinned to the primary: the middleware sets prevent_writes on both roles for a GET.

1. Where each Active Record role landed01:47:47 UTC

Two different addresses below means connects_to is doing its job. Each card is probed explicitly, so this is the machine inventory, not the routing decision.

writing

172.18.0.2:5432

state
primary (read-write)
database
replication_demo_production
replay lag
n/a (this is a primary)

reading

172.18.0.2:5432

state
standby (read-only)
database
replication_demo_production
replay lag
0.0s

2. What the primary says about its standbys

This is pg_stat_replication on the writing connection. No rows means nothing is streaming.

clientstatesync_statereplay lag
172.16.0.4 streaming async —

3. What this request read, and from where

The DatabaseSelector routed this poll to the reading role, so the rows below came off 172.18.0.2:5432.

idwritten inmessagecreated at (UTC)

Nothing yet. Write a ping above.