In plain words
A read replica is a copy of your database that follows the primary's changes and answers read-only queries, taking load off the primary at the cost of being slightly behind it.
Where you see it
Harbor's usage reports and admin screens run heavy queries all day, so the team points them at a replica and frees the primary for checkouts and deploys. Then a customer renames a project, the page reloads from the replica, and the old name is still there for a moment.
What goes wrong
- Reading your own write from a replica
The user saves, the next page reads from a replica that hasn't caught up, and their change seems lost. Send a user's reads to the primary for a few seconds after they write, or for that whole flow.
- Assuming lag is always small
Replication lag is usually under a second, but a large migration or a long-running query on the replica can push it to minutes. Monitor lag, and stop sending traffic to a replica that falls too far behind.
- Using replicas to fix slow writes
Replicas only take reads; every write still lands on the primary, and is replayed on every replica too. If writes are the bottleneck, look at indexes, batching, partitioning or sharding.
What to tell your agent
Quick check
Sign in to earn +10 XP for itAfter Harbor moved project pages to a read replica, some users rename a project and see the old name until they refresh. What's the fix?