Search code examples
couchdbcouchbase-lite

Is it possible to implement data synchronization between Android-based devices using Couchbase Lite even in offline mode?


I want to implement data synchronization between mobile devices connected to an internal WiFi network using CouchDB clustering. Since I cannot directly run CouchDB on Android OS, I need to use Couchbase Lite. However, I also need a server to run the replicator. I don't actually need to sync data with a server, I just need data synchronization between mobile devices. I'm curious if there is a way to implement CouchDB Replication functionality using Couchbase Lite without the replicator.

I tried to set couchbase lite on android app.


Solution

  • If you have an Couchbase Lite Enterprise license there are two different ways that you can synchronize data between mobile devices:

    • Run a URLEndpointListener on one or more mobile device (passive, or server devices, in the documentation). Other devices (active or client devices, in the docs) run normal Replicators that connect to the listener
    • Use the peer-to-peer sync mechanism. This is a bit more complex and requires some implementation but is more adaptable. It can be set up to discover and synchronize with peers automatically.

    Neither of these two methods involves CouchDB Clustering and neither synchronizes data with a CouchDB server.