MongoDb Database vs Collection

后端 未结 3 1145
执念已碎
执念已碎 2020-12-05 19:14

I am designing a system with MongoDb (64 bit version) to handle a large amount of users (around 100,000) and each user will have large amounts of data (around 1 million reco

3条回答
  •  青春惊慌失措
    2020-12-05 19:25

    So you're looking at somewhere in the region of 100 billion records (1 million records * 100,000 users).

    The preferred way to deal with large amounts of data is to create a sharded cluster that splits the data out over several servers that are presented as single logical unit via the mongo client.

    Therefore the answer to your question is put all your records in a single sharded collection.

    The number of shards required and configuration of the cluster is related to the size of the data and other factors such as the quantity and distribution of reads and writes. The answers to those questions are probably very specific to your unique situation, so I won't attempt to guess them.

    I'd probably start by deciding how many shards you have the time and machines available to set up and testing the system on a cluster of that many machines. Based on the performance of that, you can decide whether you need more or fewer shards in your cluster

提交回复
热议问题