High Interaction (web app) / Views / Stale
My group has been learning Couchbase for the last couple months and we are having a great deal of success. There seems to be one stumbling block remaining. Our web application is highly interactive. Users are allowed to enter records (documents) and data from those records is summarized in lists immediately after entry. Currently the contents of the lists come from views we've created in Couchbase. Due to the behavior of the "stale" parameter the first hit after entering several records is inaccurate because "stale" defaults to "update_after". We can easily change "stale" to "false" but we've heard in a couple of videos that if you have to do that your probably doing something wrong.
It's important to note that we're using views because we have a multi-tenant system where we need to filter down the results based on an identifier assigned to the user using the web application in order to prevent that user from seeing data that isn't theirs.
There doesn't seem to be a way to query documents via the sdk without knowing the key for the document we need. If so we could query for the data immediately and receive anything that has made it to the in-memory cache. This would keep us from running into the stale issue with our views and still allow us to query for documents by user id.
We haven't yet looked into ElasticSearch usage with Couchbase, but it seems like that could offer a solution.
Any advice is greatly appreciated!