I am building an eCommerce system that uses composite bucket hashing to efficiently group similar items. Without going into why I chose this system, suffice it to say it solves several key problems facing distributed eCommerce system.
There are 11 buckets, all of them ints, which represent various values. Let's call these fields A to K. The 12th field, L, is an array of product IDs. Think of this all as a hierarchy with the leaf level (L) being data.
I ran some initial tests in MongoDB where I stored this data as individual documents. However, this is not efficient because a given set of A to K could have many L values, so these can be stored as an array.
This gives me two options:
I know #2 is a highly unconventional use of MongoDB. Are there any technical reasons why I shouldn't do this? If not, using the official C# driver, how would I perform this insert?
If you went for option #2, you could perhaps create your own optimised composite id (using A-K) using a Custom Id Generator.
Did you run your tests on compound keys?