Integrating couchbase server with existing server

Hi all,
I have an Android client and web server implemented using following technologies
SQL and NoSQL databases
-PostgreSQL
-Elasticsearch
Application
-Spring MVC architecture
-Hibernate JPA
-Wicket framework
Web Server
-Jetty

currently the Androi client connects with the server using RESTful Web services (to post user data collected by the client). Client does not have an embedded database. What I need to do is to enable the client work offline with an embedded database. So the user data will be saved to the local db and data will be synced with the server when the client is online.

So I am clear that I need to implement CouchBase lite to the android client app and also need to implement SyncGateway to sync the data. Since the sync gateway needs a couchbase server to replicate, I am clear that I need to implement a couchBase server too. But my problem is how to connect my existing server with the couchbase server?

Thank you
Isuru

How about this?

  • Set up couchbase server + sync gateway on your server (or different server)
  • Set up shadowing for your sync gateway database
  • Write some code in your existing server app, that sync’s data from your postgresql db to couchbase. Eg, every time an item is updated on your server, push that same change to your shadowed couchbase server. And possibly another script that pulls changes from your shadowed couchbase bucket into your existing app.

Would this approach work? I ask this, because that’s a solution I’m currently trying to implement for my existing web service :wink:

Hi Humphrey,

thank you for responding. Seems to me your idea is great. But will it be possible? I mean I do not have any experience using couchbase. I am completely new to this. What do you mean by “shadowing the sync gateway” ? We have used elastic search in our existing server. Since couchBase server has elasticSearch plugin integration…Will that approach work?