Should I handle the Couchbase bucket as a table or is it more like a schema

I plan to use Couchbase as a documentation repository in my web application. I am looking at the Couchbase Client for Java , and you need to create a separate Couchbase Client for each bucket if I process the Couchbase bucket as I will be looking at a common object. This is a bit redundant for the system (although I can reuse the executable service to minimize object creation and the overhead of managing threads.)

So,

  • Is there a way to reuse an existing CouchbaseClient for multiple buckets (not just adding an ExecutionService)
  • It would not be better to use a single bucket and distinguish between key-based objects and rely on the view selector for queries in terms of performance.
+4
source share
2 answers

You must treat the couchbase bucket as a database. One package is enough for the application in most cases. But I prefer to have 2 buckets. One for general data and one for “temporary” or “quick changes” (for example, cache, user sessions, etc.). For the latter purpose, you can even use only memcached bucket.

And answering your 2 questions:

  • , - . , singleton-. , 2 , 2 ( )

  • , bucket, . test. Couchbase dev production, dev.

+7

All Articles