Instead of sharding base on the data, can I shard based on where the request (IP address) coming from?
Hmmm one trick I think of is the data itself contains IP address. Is there another way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you’d need to include an IP address field in each document and include it in your shard key. Choosing a good shard key is quite a tricky thing to get right, it depends a lot on the shape of your data and how it’ll be queried.
Here’s a good place to start: Choosing a Mongo Shard Key