Couchbase data read/write not happening in time


Hi all,

I have an automation tool that runs multiple test cases. The tool is executed by consuming APIs from my cloud application, which then internally connects with Couchbase
Each test case perform all the CRUD operations upon a single document in a synchronous, single-threaded operation.
I have kept a delay of 500 ms between each operation. So a POST operation is executed, then after 500 ms, a PUT operation is executed and after 500 ms, GET is executed and then after 500 ms, DELETE is executed.

The issue is, I get test failures during GET and DELETE operations. While executing GET, I am able to get the document, but DELETE fails, as it is unable to find the document. Or in some cases. GET does not return anything, but DELETE is able to delete the document.

Also, the test failures vary during each execution of the tool. So one test that passed in one run might fail in the other.

Any one have any ideas as to what could be wrong? Or has anyone ever faced something like this?


If anyone is wondering, we had an index issue. Basically, we were using 6 different indexes for 6 different objects. So the CB Server was taking time to figure out which index to hit to get the necessary data. We consolidated all the indexes into one. The trade-off is that we suffered a hit on our performance metrics for the application.



Thank you for sharing your solution. Could you talk a bit more about how indexes affected your get/delete operations? Were you using a N1QL query somewhere in there?


Hi @matthew.groves,

Yes, we were using some SELECT queries during our GET and DELETE operations. We theorized that due to 6 indexes, the query was taking time to hit the correct index. So consolidating all the indexes to one single index helped reduce the time taken by the query