Suggestions for replication of data from MS Sql 2005 and MySql

只谈情不闲聊 提交于 2019-12-06 04:37:50

Friend of mine for almost the same case (he copies some data from just a few tables from MSSQL to MySQL) built something like that:

  • Added trigger to each table which will be replicated. Trigger save primary key, operation type (i)nsert/(u)pdate/(d)elete and source table name in special table (less or more).
  • Small .NET app scans this special tables for new keys every few minutes and reads data from source MSSQL tables and save them in destination tables in MySQL (less or more).

This works fine because:

  • Tables don't change a lot.
  • He copies just a few columns.

Pros:

  • Fast & easy to implement & change.

Cons:

  • In house made tool is not perfect :).

I think it depends on what reporting software you'll be using on top of the MySQL database. If you're using Pentaho - they have software to handle this situation. If reporting is just going to be ad hoc and the structure will remain exactly the same, I would seriously consider setting up another MSSQL instance and working with that. If you already have MSSQL, don't putz around trying to make the two friendly with each other. You should be able to have the second MSSQL instance tied down to only limited resources so that the transactional db never gets impacted even if they're on the same machine.

A third-party application claims the ability to do this: Daffodil Replicator. I think it's available both as Open Source and Enterprise.

SSIS ETL seems like the simplest way to go. You could actually export to a staging area (CSV files) and than import to MySQL. This would take care of different format problems. If you get creative, MySQL supports the CSV storage engine (see here), so this could save the load step in SSIS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!