0

Can someone explain why they say db replication is more ideal for read scalability while sharding is more ideal for write scalability?

From my current understanding:

  • replication allows read traffic to be distributed among several replicas rather than a single node, increasing read traffic. Does this not also apply to write traffic?
  • sharding allows a very large db node (say for example 10 TB) to be split into several smaller nodes, which allows traffic/queries to be a lot faster (since it does not need to search through 10 TB of data). Does this not apply to both read and write traffic?

1 Answer 1

0

Sharding can make a case for both depending on the type of workload (I/O pattern). If the writes are heavy and also not happening to just a few keys of the same shard, then distributing them over a bunch of machines reduces the load per machine allowing you to pump more writes. If the read pattern is also well distributed so that it doesn't create hotspots on just a few keys, then yes you are right.

Replication can never make a case for write scalability because every update has to be sent to all the replicas. In that sense, is actually the opposite of scalable as it causes write amplification.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.