I am using google app engine for my backend and datastore as the DB. The link https://cloud.google.com/datastore/docs/concepts/limits indicates that the maximum number of composite indexes for a project cannot be more than 200. I have around 130 composite indexes in my project and would hit the limit sometime in the future.
Limit of 200 seems very less to me. Let's say I have 5 modules in my project and each module has 10 "kinds" each. In each of the kinds, I have 4 properties I want to index upon (let's call them prop1, prop2, prop3 and prop4). Also each of the "kinds" have a field called creationTime, which stores the time at which the entity was created in the datastore. Whether I apply 0, 1 ,2 ,3 or all 4 of the filters, I always want my list of entities to be sorted by creationTime with newest first.
This seems to me to be a perfectly reasonable scenario. In this case for each "kind", I would have to define the following composite indexes
<datastore-index kind="kind1" ancestor="false">
<property name="prop1" direction="asc" />
<property name="creationTime" direction="desc" />
</datastore-index>
<datastore-index kind="kind1" ancestor="false">
<property name="prop2" direction="asc" />
<property name="creationTime" direction="desc" />
</datastore-index>
<datastore-index kind="kind1" ancestor="false">
<property name="prop3" direction="asc" />
<property name="creationTime" direction="desc" />
</datastore-index>
<datastore-index kind="kind1" ancestor="false">
<property name="prop4" direction="asc" />
<property name="creationTime" direction="desc" />
</datastore-index>
Since there are 50 such kinds, there would be 200 such indexes. Now I know I can avoid these indexes if I don't sort the list of entities by creationTime, but I think that would be really bad from the user perspective.
So is there any way to increase / overcome the limit? Am I missing something here? Do I need to limit my queries ? If yes then how can I achieve the same user experience? Is datastore not meant for such queries? What options do I have here?