Realtime synchronisation setup with SQL server

data_modelling
n1ql
query

#1

Hi everyone,

I’m currently creating an data synchronisation between an ODBC connection with an SQL Server 2014 behind it. If there are any changes in the database on specific tables, I want to create and modify documents in the couchbase database.

The data is unstructured and I want to restructure the data. In the SQL database the relationships between the tables are not very handy for Couchbase. Now I want to know what the best option for this is to update everything realtime with Couchbase. I cannot modify the current SQL server database structure.

An SQL server table example:

  Address > Address id
          > country id
          > Street
          > Street number

  Country > country id
          > country name

Then you can get the country by requesting the country from country table.

I at first thought this would be the best option without using N1QL:

  1. Unstructured data from SQL server
  2. Structure data using queries when changes are in SQL server db
  3. Send structured data to Couchbase
  4. create/update views

It’s unclear on how N1QL works. I was thinking the following way:

  1. Unstructured data from SQL server
  2. Send unstructured tables to Couchbase as documents
  3. Structure data by using N1QL and storing it as documents (Or as views?)
  4. create/update views according to structured data generated by N1QL

What is the most ‘Couchbase’ way of doing this? Must I trigger certain queries when changes are made?

Thanks in advance