I know array indexing is available on Couchbase Server; is there a plan to implement this for Couchbase Lite? We have a database with 100K-1M documents. With Couchbase Lite 1.4 views we can effectively index arrays on those documents and query them. Performance is inadequate with Couchbase Lite 2.5.
We’re exploring alternatives, such as creating our own ‘lookup table’ of docs mapping the keys to the parent docs on the device, which helps, but is still less performant than on 1.4. We are also exploring creating those lookup docs in sync gateway, but that can increase the number of docs to replicate by 3x-10x, which will likely have a significant adverse impact on replication performance.
If support for array indexing on Couchbase Lite is coming in the near future that would be very helpful to know.
It is definitely on our roadmap but this will unlikely be in the “near future” (as in the next release)…so if you are looking for a solution in next few months, you may have to look at alternative ways to implement this.
W.r.t the lookuptable approach, have you considered doing JOINS …have a doc that maintains this mapping and then lookup matches? JOINS should be performant. Would be helpful to see what kind of performance numbers you are seeing
Or while not ideal , can you consider modeling /normalizing the docs that’s pushed to the clients so client side queries deal with a flatter document and again, use JOINS for querying across docs
Thanks for the response, Priya. Yes, we’re doing JOINs on the lookup docs we create. That eliminates the slow query problem, but we still have the problem of creating all those lookup docs. With a DB of 700K documents, we might have on average 5 lookup keys per doc, which means 3.5M lookup docs. We’ve tried creating them on the fly client-side, but that took an hour to process only 50k documents, so not an option. We’ve tried creating the lookup documents in sync gateway, but that adds 2 hrs to the time it takes to replicate all the data to the client.
Still searching for a solution that will keep us at par with Couchbase Lite 1.4.
I’m curious what the current status of array indexing is for Couchbase Lite. We’re planning a change to our document model to allow multiple user ownership, which would require our filter queries to perform an ARRAY_CONTAINS() instead of an equality expression. I haven’t tested the change to gauge performance impact yet, but would expect these queries to be slower and hoped there would be an index solution available. We also have potentially 100K+ documents to query on the high end.