Leveraging live-data from SQL Server

Hello,
my case is as follows: A client approached us asking for an “add-on” (as he calls it) app to manage some aspect of their work. The thing is, they already have a huge system in place, a complex assortment of software they installed over the years, all relying on the same server running a single SQL Server instance.

And so my question is the following: Is there a way to leverage data for Meteor from an SQL Server instance? Much like what is done with Mongo or CouchDB, all the while retaining the reactivity of Meteor with publications and subscriptions? After much search I haven’t found any conclusive answer, and so here I am.

In a word: How would you go about it if you had to absolutely use Meteor?

Thank you for your time.

What type of SQL server are you trying to connect to?
Here is a package for MySql:
https://atmospherejs.com/numtel/mysql
I am using this package and it works; however, I am running into some issues.

Here is a package for Postgres
https://atmospherejs.com/numtel/pg

I am looking into using GraphQL to interface with a SQL server so you may want to look there as well.

I think @unforgiven is referring to SQLSERVER (MSSQL)

If that is the case, I have played with creating a package that uses Change Tracking; you may want to look there. It is not as easy as installing a package, but you may be able to write something that works with the Change Tracking in MSSQL. Best of Luck.

https://msdn.microsoft.com/en-us/library/bb933994.aspx

Yes, there is an SQL driver with livedata support: https://atmospherejs.com/vlasky/mysql
But I believe it’s only for MySQL - you may need to look into the underlying NPM that does the binlog tracking, maybe something can be done with it.

@robfallows Indeed. I am referring to MSSQL.
@mysterymac I won’t lie to you, I was kind of hoping for a ready-made solution. We have very strict time constraints on this one project, I won’t really consider this unless I’ve run out of options.

Could an intermediary work? I was thinking of connecting Meteor to a MySQL server, which is itself synced with MSSQL. Would that even be possible?

If you definitely need a livedata MSSQL then I think you may be out of luck. However, connecting to MSSQL is simple enough (we use sequelize internally, but there are others). In this case you would typically use Meteor’s call/method to move data between client and server/database - or you could also use Apollo for this.

Synchronising MSSQL with MySQL seems to be an area not well represented (there are solutions for the MySQL to MSSQL). Even tungsten does not appear to have a solution for this. In theory, you could set up triggers on those tables you want to replicate and use those to write to an intermediate replication table which you could then poll. Nothing here seems to be off-the-shelf.

1 Like

Thank you. You’ve given me food for thought.
Good day.

1 Like