desautelsj
desautelsj

Reputation: 3715

DocumentDb partitioning strategy for real estate data

Say I am building a documentdb collection of real estate properties in US and Canada (eventually, I may need to add other countries as well) and I expect to have several million documents in my collection. Also, let's assume that the most popular query will be to retrieve the top X properties within a certain radius from a given location.

Given these requirements, what would be a good partitioning strategy? Would using the ZIP code/Postal code be a good partitioning key? Would a strategy involving the geo location be better? Any other suggestion?

Upvotes: 0

Views: 169

Answers (1)

Larry Maccherone
Larry Maccherone

Reputation: 9523

Actually, I suggest that you use partitioned collections and use the id as your partition key then use geo queries. It's dirt simple and will get you maximum fan out on your queries which will give you the best throughput. Later, if that doesn't work, you can think about a more performant partitioning strategy.

Upvotes: 1

Related Questions