I am currently working on a project where I am using MongoDB as database with multiple collections. My biggest collection will likely not have more than 10000-15000 documents in the future, currently there are about 5500 documents. There are 8 fields I use for querying the collection. I am now looking for an indexing strategy. My problem is that all 8 fields are not obligatory and can occur in different combinations. This makes creating compound indexes very hard for me. Does anyone have a suggestion how to solve this?
I came up with 15 compound indexes for the collection, which I would think cover some of the most important queries. Are these too many for one collection? I am also periodically inserting/updating data to the database from another data source so I worry about slowing down the writing performance too much. Users only perform reading operations. I am also not sure if indexing makes sense for such rather 'small' collections. With the actual size of 5500 documents non-indexed queries take about 6-8 ms to be completed.