1

enter image description here

I have read the guide and they say

Query Router Sharding is transparent to applications; whether there is one or one hundred shards, the application code for querying MongoDB is the same. Applications issue queries to a query router that dispatches the query to the appropriate shards.link to guide

Does it mean i dont have to care about the router? or is this a specific machine? i dont get it.

0

It means applications don't have to care about what machines the shards are located on. You have to know where at least one of the query routers are because that's what you tell your driver in order to access the system. In practice the query routers may or may not be on the same physical machines as the shards, and query routers are separate processes from the application, not necessarily separate physical machines. Most commonly they are on the same machine as the application servers, but it depends on your individual needs.

This is in contrast to some databases where the application has to be aware of the sharding. For example, you might have to connect to a different server to query last names beginning with 'A' than last names beginning with 'B'.

  • so the use of the mongos is the build in auto-sharding function from mongodb? – Khan Jan 20 '17 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.