Reputation: 1490
we are going to use mongo db for an alert monitoring application.
We thought first to write the data to files and then to write it onto mongodb using mongoimport utility. Each file will have 1Mill records on an average.
Here my question is "shall we sharding here...?"
I guess mongoimport is not aware of sharding. How does sharding works when writes are happening by mongoimport...?
Upvotes: 0
Views: 632
Reputation: 230326
If your collection exists and is sharded and you run mongoimport against a mongos router, then it will respect sharding rules (writes will be distributed according to chunk location).
If you have a mongodb cluster, you have to have mongos
daemon(s) in there. mongos
reads your cluster configuration from config servers and knows where to route requests from your app. In a cluster configuration you should never talk to mongod
servers directly, only via mongos
. Read more about cluster configuration here.
Upvotes: 1