Many people said that one can achieve higher performance by creating read-only and write-only database, be frankly, I can't fully understand it. Some people told me that writing will require many different locks, which will slow down the reading...but as my understanding, many reading in a system doesn't require locks, such as oracle consistent read, how do the locks affect reading? Besides if i want to shard database, does read/writing separation offer more value?
Can you give a detailed explanation or provide some external resource about why read/write separation can offer higher performance, thanks.
For one, separating reads and writes allows your database to scale using master-slave replication.
In master-slave replication, the master can handle both reads and writes while the slaves handle only reads. The slave then replicates any write statements done on the master.
This allows read-heavy applications to spread reads across multiple machines. However, if your application does lots of writes and not many reads, you may see no benefit.
Separating reads and writes from the outset in your application gives you the flexibility to go the master-slave route at any time, and isn't very hard to do. You can simply have your database abstraction use the same connection for both when such functionality isn't necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With