CBL Lite and MS Sql server sync


We have a main MS Sql server. This is the main data source that delivers and receives data to and from backend administration (desktop) and (in development) mobile software. It is relational of course. We need to make a connection to mobile. That is: the mobile application needs to be off- and online available. The data on mobile needs to reflect the state and data on the MS Sql server.

The original idea was / is to set up a couchbase server, sync gateway (replication) and Couchbase lite (mobile). We need to communication with the MS Sql server to keep it all up to date. I was thinking about the weight all these services put on the server as one device. Are there any possibilities or ideas to cut out the middle man and let Couchbase lite communicate and replicate with the MS SQL server directly? Or is setting this up without Sync Gateway a bad idea?

Modelling and mapping is no problem. We have a fairly sound connection between our .NET Model and CBLite documents. It’s just the whole replication process that’s bothering me. I don’t want to stress the resources on the server and keep the footprint of the cycle as minimal as possible

1 Like

I think either of the following architectures would work:

MSSQL / CB Connector

MSSQL / Sync Gateway Connector

In both cases, you would need to create a bidirectional connector between MS SQL and Couchbase Server. It could either go directly between the two, or it could also go through Sync Gateway.

The advantage of going through Sync Gateway would be to leverage the changes feed to subscribe to new changes. There is also work in progress to add an Eventing API to Couchbase Server.

1 Like

To answer directly, there is no current way to go between CBL and SQL server without Sync Gateway. SG does a lot of book keeping you’d need to reimplement. I would not recommend trying to set up something without it.

1 Like

Yes, and in addition SQL Server is not typically exposed to the public Internet, which is a requirement for Couchbase Lite.

1 Like

Thanks @traun @hod.greeley for the replies! Love this community :slight_smile: