synchronization - Synchronizing 2 databases -


I have a database of MySQL and other databases that run on MS SQL MySQL is the backend database of my website running on Joomla I have an ERP to run my shop. This ERP is made in a net by a third party.

Every time a user orders on my website, a table named order is updated. Order details in my ERP in my orders table Should be done. The table structure in the two databases is completely different, so I'll do the mapping myself.

My questions are:

  1. How often should I transfer data from my database? For MS SQL?
  2. Someone has suggested that I can write a web service which would periodically pump data in my table in ERP, so I started thinking about the Nasap server service. Is this the right way or is there a better way of doing this ??
  3. I must also obtain inventory related information from my ERP in my MySQL database also.

1: It depends on how much your data The bar is changing, and how often you need to sync (i.e., depending on your business).

2 & amp; 3: A web service can work just fine to transfer data. But as long as you are not trying to come up with a general solution, it seems that it is a lot of trouble compared to the price.

If I was doing this, I would export the data to SQL Server in a file, then import that file into mysql ( mysql my_db & lt; file.sql ) Will do

In this format, getting data from SQL Server is not so easy (see mysqldump on SQL Server) but for some ideas see.

If the data is consistent between the system (if the columns are the equivalent data types), then you can overcome the table structure differences by creating a query in the SQL query that exports the data in the correct order. .

In fact, you can create a query that is imported to mysql file.sql for example, for example a question like:

  SELECT CONCAT ('Insert in hidden values ​​(', myColumn, ',' MyOtherColumn, ');') SLAD statement  

Output produces something like this:

  Include in the interpreted values ​​(myColumnValue1, myOtherColumnValue1); Insert into esoteric values ​​(myColumnValue2, myOtherColumnValue2); ....  

I have exported data from SQL Server at least one occasion.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -