I like to sync and process any change to any table of a SQLAnywhere DB and send the changes as JSON to my messaging system. What are my best options

  1. I could create triggers for all the tables and store them in audit table, then query the audit table send the changes to the messaging system as JSON.

  2. I think I could use mobiLink and write a Java class that forwards the changes to my processing system

I feel mobilink might be the better option as it's a more "out of the box' option ? Does anyone have experience with this scenario? Any ideas? BTW, I ignored SQL remote as the delta changes/ the data sent by SQL remote is not easily machine readable.

Thanks a lot in advance Frank

asked 20 Oct '16, 06:24

flangel's gravatar image

flangel
2635
accept rate: 0%

edited 20 Oct '16, 06:26

Presumably a MobiLink solution would treat your SQL Anywhere database as a remote database, and use the dbmlsync.exe synchronization client to capture all the changes from your SQL Anywhere database transaction log and send them to the mlsrv16.exe synchronization server for processing. That's where it gets interesting: in your scenario, you don't need a consolidated database, just some MobiLink scripts to process the stream coming from dbmlsync.exe... but AFAIK mlsrv16.exe won't run without connecting to a consolidated database, so I'm guessing you'll need a second SQL Anywhere database to act as consolidated... it may be more trouble than it's worth since you won't be using much of MobiLink's functionality, but you will have to write custom code for each and every table naming each and every column.

(20 Oct '16, 15:10) Breck Carter

In addition to Breck:

You have raised a few answers w.r.t. technologies like SQL Remote and Mobilink or topics like "log translation", and it seems our answers have only partially helped.

I would therefore recommend that you tell more about what you are exactly trying to achieve... - Is it auditing, is it an "export" based on each and every change?

And what exactly should be transfered to the message system: The original DML statement, a list of the values of a particular row before/after a change, whatever?

In my understanding, if you are primarily interested in capturing the changes done to one (or a few) tables, the trigger-based approach as mentioned by Breck is the simplest and most flexible way, and if you are more interested in all changes, I would still recommend to process the log via the DBTranslateLog() API I hinted at.


As to Mobilink:

Note: Mobilink is "smart" in the way that it consolidates all changes to the same row between two syncs, i.e. if you insert a row, update it several times and delete it afterwards and all that happens between two syncs, that row is not part of ML's synchronization stream at all. That's also true for an existing row with several updates between two syncs: Only the last state will be regarded. Therefore I would think that ML is not really usable for "auditing" purposes. (That's even true when you use MobiLink with option -tu (transactional uploads).)

(21 Oct '16, 02:12) Volker Barth
Replies hidden
Comment Text Removed
1

FWIW I recently helped a client implement a MobiLink synchronization setup to replace a Replication Server setup that depended on each and every operation being synchronized separately. Triggers captured every row change in separate shadow table rows, and those shadow tables were transmitted in both directions and re-applied to the base tables. It was quite complex and had some performance issues. As Volker points out, MobiLink transactional upload is not the same as an operational (or change audit) upload. Using MobiLink for operational synchronization is not recommended as the first choice for any application... it's a last resort IMO.

(21 Oct '16, 08:39) Breck Carter
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×295
×77
×60

question asked: 20 Oct '16, 06:24

question was seen: 224 times

last updated: 21 Oct '16, 08:39