Friday, September 27, 2013

Indexing Schemaless Documents in Mongo

One of the best parts about mongo is its entirely schemaless nature. We can store any kind of data we’d like without having to worry about where that data comes from or how it should be laid out.

However, it’s sometimes tricky to index that data in a way that will be performant using mongo’s schema-less nature. For data of any reasonable size, querying must hit an index to narrow the search space and to avoid numerous disk seeks if the full dataset exceeds the available RAM.

Ideally our users can upload unforseen types of data to our system, and we can match elements quickly based upon a single index. The primary use case for this sort of thing is if we want to associate arbitrary key/value data with various documents. We then want to query on those keys, values, or both! I’d like to outline a few different approaches for how mongo can be made to query these sorts of user-specified key/value pairs efficiently.

Read more here

Leave a Reply

All Tech News IN © 2011 & Main Blogger .