Running 2 statements sequentially, the second statement needs to wait for the first to complete/commit, but this appears to not be the default behavior. In the first statement, I delete some documents. In the second query, I count all documents. The second query incorrectly returns the count of all documents, including the ones I just deleted!
$query->consistency(N1qlQuery::REQUEST_PLUS);, seemed to correct the issue.
Is this the correct way to instruct couchbase to fully ‘commit’ each request before completing/returning?
If the default behavior of couchbase is for writes to be only eventually consistent in the name of performance, I must say, I’m a bit shocked. Shouldn’t the default behavior be to prefer consistency with the option to configure eventual consistency and not the other way around?
In other words, shouldn’t any database prefer consistency to performance?
Thanks in advance.