1

We know that MongoDB uses sharding to provide horizontal scaling. These clusters support deployments with large data sets and high-throughput operations. Sharding allows users to partition a collection within a database to distribute the collection's documents across a number of mongod instances or shards. But how can sharding address scalability on an embedded and normalized collections? Which database( embedded or normalized) is better in terms of scalability?

3
  • when more data are in 1 place for example in 1 document, you need less joins, and less transactions, and more things are done locally(you don't need to combine data from multiple places), i think this is one of the basic reasons. Commented Dec 19, 2021 at 13:46
  • Χρονια πολλα!! Does that mean the emebedded one is more scalable? What does sharding have to do with this? Commented Dec 28, 2021 at 15:45
  • Xρονια πολλα :) , sharding allows a collection to be saved in the cluster(not in 1 computer only), this mean that we can have huge collections without 1 machine limitations.There is a mongodb forum with people that can give you much more reasons and details. Check this also its official MongoDB forum. Commented Dec 28, 2021 at 18:21

1 Answer 1

0

But how can sharding address scalability on an embedded and normalized collections?

It can't it will be a nightmare to maintain most likely, depending on your usage.

Which database( embedded or normalized) is better in terms of scalability?

Most likely the normalized approach will perform much better, each has it's pro's and con's however if your embedded data has updates performed on it I would personally recommend not to use this approach. Especially at scale. I also find that in many cases a structural change of the data can solve many of these issues, worth considering.

Obviously these are very broad statements, and should be considered within context of your needs.

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.