What Couch-Databases are best for using replication in Spring <-> Android?

Greetings to all,

I am a little bit confused of all the different Couch-incarnations, so I hope to find some usefull information here. My problem is, that I took over an older project to finish it and I am not sure about the database decisions that where made.

For one, there is a finished Java Spring-application (already existing), that is currently working with a regular CouchDB via the lightCouch API. Now I am supposed to write a Android App, also using some kind of Couch, because the data from the Spring-application need to be synchronized with the Android App. Most likely I will need a master-master replication and the ability to use filters.

Through my research I found out, that CouchDB can use a direct replication with Couchbase Lite up to version 1.4, newer versions won’t work because of the new replication protocal in CBL 2.0. There also seems to be a restriction, that filters in replication pull are not supported from CBL 1.2 and ongoing.

My question is this: What should I use best to sync the data between the Spring Application and the Android App?

  1. Does this construct with CouchDB replicating directly with CBL work well? Could I stick with that? (This way I wouldn’t have to rewrite much in the spring-application)

  2. Would it also be possible to use CBL on BOTH? Looks like CBL can be directly used with Java. (Are there any known performance-issues by using CBL in Spring applications?) I am very interested in avoiding to install many additional software on the workstations. Also is Sync Gateway necessary for this replication or can CBL replicate directly with another CBL?

  3. Should I do a complete switch and go for Couchbase and Sync Gateway? (Not my favorite option, but if it is necessary/best to do, then I should)

Also if there are better options I didn’t consider yet, please feel free to point me in the right direction :slight_smile:

Thanks for reading and helping me out here.

@arwig,

Yes , you can do Peer to Peer Replication. Here is a blog post on a basic photo sharing. PhotoDrop: Peer-to-Peer Photo Sharing App | Couchbase Mobile (its written for IOS but the concept is the same in Android)

I would say Yes, else you have to support any kind of custom build web based replication app which many people don’t want to do. Most people want something simple , with Docs and Supported now and in the future so they can focus on core parts of the project and requirements. Many people are really excited about the upcoming SG 2.x & CBL 2.x where there will be Delta Sync which means the only the changes in a JSON document will be replicated to the device and vice versa.

So CBL 2.x will still support HTTP based _changes feed replication AND it will have the new BLIP(websocket based) replication too. The new blip replication comes from people wanting higher performance as data size / amount and mobile usage grows. Here is link talking about the new BLIP based replication. Replication Protocol · couchbase/couchbase-lite-core Wiki · GitHub

In Couchbase 5.x and SG 1.5.x there is the idea of convergence where you can update a document via SDK or Spring framework and it will get replicated to the device.

So CBL 2.x will still support HTTP based _changes feed replication

Actually one correction here – CBL 2.x is websocket only and will be 0% compatible with CouchDB.

@arwig overall, Couchbase Lite is dropping compatibility with CouchDB going forward, so if you go the CouchDB route, you’ll be stuck on older 1.x versions of Couchbase Lite and not able to use 2.x. This google groups discussion has more backstory.

Allrighty then, thanks for your answers so far.
It looks like Couchbase might be the best way to go.

Anyone else has some insight not yet mentioned?