Two part question:

  1. What is the industry best practices for handling a major DNS change?

  2. I have an app that uses Mysql the app was replicated on both servers including the database. During DNS propagation some users data was stored on server A and some on Server B. What is the best way to consolidate/sync this data?

link|improve this question
This really sounds like two separate questions – Goyuix Nov 8 '10 at 16:53
feedback

2 Answers

up vote 1 down vote accepted

Moving MySQL databases is generally going to have some downtime. In the case above, what you might have wanted to do was setup a VPN between site A and site B. At the start, sync Site B MySQL to site A's MySQL using replication or a DB dump. Then change all of the webservers at Site A and B to use Site B's Mysql via the VPN. Then change the DNS entry. Users that have DNS cached to site A will see some latency due to the MySQL connections running over the VPN, but over time those will get moved to B.

You can also prep for this by reducing the DNS TTL a few days before the move. Try setting the TTL to five minutes, some servers will ignore this, but most will not. This will increase load on the DNS server, so be careful.

link|improve this answer
How can I fix the issue with the two different data sets? – sanbornm Nov 8 '10 at 16:58
Good point about preparing the DNS TTL.. i forgot that part.. :D – Arenstar Nov 8 '10 at 18:25
Fixing the data inconsistancy will be hard, it will have to be fixed at the application level. You may have to hand merge the records that exist on one site to another. If you are lucky that will only be a handful of things to fixup, but you have to careful and make sure you fix all of the records. For example, maybe the only difference is a few users got created in A but not in B. You might have to readd those users to B, either thru the application or via the database directly. Don't try this unless you really know the db schema well. A tool called MySQLdiff may be helpful. – mfarver Nov 8 '10 at 22:36
feedback

This is 2 seperate questions..

What DNS servers are you using? and why a mysql backend??

Consider using TINYDNS.. its extremely fast and light and scalable..

You should be able to make this change without downtime at all.. Rolling servers into the new DNS changes.

Your MYSQL problem is quite complicated.. i would assume application specific

link|improve this answer
I am using Dyndns, and changing the name server at the domain registrar. – sanbornm Nov 8 '10 at 17:28
1.)Remember to firstly sync the "new" servers 2.)Point the NS's to the "new" dns servers 3.)Wait.. id say 72 hours (depending on your country this differs) you can do rolling changes without any downtime.. just keep your old servers up.. while your new ones are ready and are pointed too.. – Arenstar Nov 8 '10 at 17:32
That is basically what I ended up doing, but then the data gets separated between the two mysql instances. I suppose I could have modified the app to point to the new server's IP address as mfarver suggested. – sanbornm Nov 8 '10 at 17:45
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.