Reputation: 384
We are looking to implement Lookup-Hash portioning strategy and I was wondering if this is possible using .NET SDK.
Essentially, we were thinking of creating a lookup map and create a resolver based on that and then use same collections used in lookup and generate the hash resolver. Is this the right approach?
Upvotes: 0
Views: 169
Reputation: 76
Generally speaking, if you can, you should use the PartitionResolver in the DocumentDB SDKs. That resolver uses a consistent hashing algorithm which will evenly spread your data against the available collections.
If, however, your data is structured where you know that certain documents need to be either in the same collection or evenly partitioned (consistency vs. load balancing/perf.) then rolling your own lookup-based resolver would work.
If you do want to roll your own, the strategy your described would work well. The things to think through would be
Upvotes: 2