Most people get this wrong about the master-replica setup

Arpit Bhayani

Arpit Bhayani

May 29, 2025 • 1 min read


Most people get this wrong about the master-replica setup.

It is a common misconception, spread through popular books, people, and courses, that in a master-replica setup, the master node will only handle writes. This is incorrect.

In a master-replica setup, writes go to the master does not mean reads cannot go to the master. The writes and the critical reads go to the master, while the reads that are okay working with stale data go to the replica to reduce the load on the master.

Hence, the backend code might have two database connections created, one with the master and one with the replica, and depending on the operation, we pick the relevant one and fire the queries.

Critical reads are usecase specific. Some APIs or operations require a consistent view of the data, for example, reads during transactions, reading the account balance of a user, etc. Hence, they will use the master connection to fire their read request on the master node.

Whenever someone says something highly generic, remember this a → b ≠ ~a → ~b

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses