0

For my new application , I am planning to implement customized distribution over multiple mongo databases. Will that scale well with mongoengine using switch_db ?

I am using tornado server.

Some more information.

(My userids (uid) are generated so that they belong to a specific db among my db servers.)

Messages between two users uid1 , uid2 i'll take the minimum of uids and get the sever specific for that uid , and all these messages will go into that server. Not a good example , but forgetting the actual data distribution I want to know using switch_db function with a custom distribution in mongoengine vs mongodb default sharding in terms of scaling or any major drawbacks. I feel there will be greater control when done with my application. Any helpful thoughts appreciated.

Specific reason as i assume for my wish to use application based sharding is my data is heavily tag oriented and practically no scans over the data.

Community
  • 1
  • 1
user303730
  • 384
  • 1
  • 5
  • 15

1 Answers1

0

I advice to use mongodb sharding unless you have a precise reason. It's like recreating your own memory manager instead of reausing something that has been tested, and works well for the vast majority of users

And more important, you will be able to do query accross all data (in all shard) instead of splitting the query by yourself in smaller queries

tomsoft
  • 4,448
  • 5
  • 28
  • 35