Hi. all
I’m newbie to CB(couchbase)
currently I’m working on using Java
some questions there…
through the API I learnt about
if I know doc’s id then I can get document using
bucket.get("doc Id")
and it does work as sync
when data has inserted using following methods
bucket.insert("doc Id", JsonDocument, PersitTo/ONE)
and it is return response always. that means it work as sync
is that right? I’m hesitating before apply to our production.
From the bucket interface, all operations are synchronous. There is an async counterpart behind [bucket.async()](http://docs.couchbase.com/sdk-api/couchbase-java-client-2.4.1/com/couchbase/client/java/Bucket.html#async--)
which gives you an API based on RxJava and Observables. That’s all in the AsyncBucket
class. The docs have an intro to using this API and Observables.
So the high level answer is yes, if you’re just using the default Bucket
from .openBucket()
, you are doing synchronous operations. Any asynchronous operations are done with Observables.