How can I sync CouchBase with RDBMS?

Hi All,
We have interrelated applications with two behaviours, one is web application ( admin users ) and another one is mobile application ( normal users ), whereas we took the decission to use couchBase as repository for mobile application and mysql as repository to web application. Can you please let me know, how can both will sync together ( If we enter something in couchbase, the same should be available with mysql and if we remove something from mysql, relevant document should be removed from couchBase ).

Can any one please let me know, is it possible or not?, your help would be highly appreciated. Thanks for your time.

There is no standard one-to-one schema conversion from a MySQL to Couchbase. This is not because it is not technically possible, but more for practical reasons. From years of experience, we have found that a one-to-one conversion does not lead to the best performance or highest and best use of Couchbase. What we have found is that a purpose built schema in Couchbase for an application that plays to the strengths of Couchbase and the access patterns of the application is the best option.

That said, a common starting point for most people is convert their existing relational data model to create separate documents types, one for each table in their relational database and each row of that table becomes a new document in Couchbase of that type. This provides an initial view of their data in JSON for them to visualize. They usually find out quickly that there are ways to optimize the schema for how their application functions and for best performance in Couchbase. Most people then progress to design their schema around application and user access patterns, not database storage needs like many have to do with relational databases. In Couchbase, we like to talk about optimizing for the applications “hot path”, meaning what data access patterns are the most critical and for what reasons. The schema can be tailored to these access patterns. This will ultimately offers architects and developers greatest flexibility and performance, but also the other reasons people switch to a database like Couchbase.

One you have that Couchbase object model, then your own tool to move data back and forth is what most people do.

Thanks Kirk for your reply with explanation. Can you please have loot at below scenarios as well, your help would be highly appreciated. Thanks for your time.

  1. If we agree performance issues for one-to-one conversion – how can we do one-to-one conversion?
  2. If we move data with tool, I guess, there would be data difference for some time, between RDBMS and couchBase – can you share your thought
  3. Can I listen, couchBase create, update, delete operations?

Can anyone please help me with suggesting something about above cases

May be this blog can help you:

Do you using Couchbase Mobile for mobile app to sync data with Couchbase Server?

Thanks for the reply atom_yang.
Yes we are using Couchbase Mobile.
atom_yang, will it support reverse way ( couchBase to RDBMS ) as well or it supports only RDBMS to couchBase?

yes, you can use tCouchbaseInput as Data source,you can also use tCouchbaseOutput as Date target. Talend Connecter is powerful.
and, If you using Couchbase Mobile, when you modify data from MySQL,and you want to sync to Couchbase with Sync Gateway, the Channel will not be assigned, So the Doc within channel will not be synced to your mobile.

1 Like

Sorry atom_yang, I didn’t get you.
Do you mean to say, Whenever our web application modifies MySQL even talend ETL syncs MySQL with couchBase server, the same modified data will not available with couchBase mobile?, if yes, what we need to do make it available ?, if no, can you please explore scenario, your help would be highly appreciated, thanks for your time.

yes, you should modify data by sync gateway REST API

Thanks for your great help.

Hi Atom_yang & Subbu,

How can I post data to sync gateway REST API using talend ETL, or is there any other better way to do same