Syncing date centres

  • We are currently upgrading MFK. thanks! -neo

TheRealAndyCook

Gambusia
MFK Member
Aug 26, 2010
708
0
16
Canada
So lets say we have 3 datacenters each named after its physical location.

Canada.site.com
Usa.site.com
Uk.site.com

When a user connects to site.com it trys to forward them to the closet site possible.


So, Andy who is a canadian lands on Canada.site.com

His request for index goes to apache, apache then goes to the sql server, located at sql.canada.site.com, then the sql data goes back to apache and is visible in Andys browser.


So, Jeff who is an American lands on Usa.site.com

Like andy, his request for index goes to apache, then to sql.usa.site.com, then the sql data goes back to apache and is visable in Jeffs browser.


Now John has been using the site and is about to make a update.

Johns data gets sent from the apache server @ Uk.site.com, apache tells sql at sql.uk.site.com to update with the new data, then John can see the data when he views the page.


HOWEVER, when Andy Or Jeff visit the page, they will not see johns update, because they are not on the same servers they will not be loading from the same SQL server.

Similarally if Andy or Jeff make an update neither will see it.


This is where we implement the syncing script. When John made his update, the apache server at uk.site.com also sent out a "warning" to canada.site.com and us.site.com that a change was made and where the change is located.

Canada.site.com and us.site.com then go an get the new data and update there respective sql servers.


The whole update takes appropriately 2 times the total latency from server to server plus the latency from sql to apache. Since the databases are typically located on fibre backbones, the update MAY propagate Faster then the original user will get the original page back.

(thus taking that math into effect a fast users in the states might actually see the change before the user making the change in the uk)
 
Doubtful.
 
I actually find your posts very interesting, I usually read the programming ones because I have an affinity for some of this stuff. There's just not much to say in response, lol... especially in the MFK lobby.
 
I bought some fish the other day......just sayin....
 
Madding;4994908; said:
I actually find your posts very interesting, I usually read the programming ones because I have an affinity for some of this stuff. There's just not much to say in response, lol... especially in the MFK lobby.

My last few threads seem to get similar view counts as other threads in the forum, so I assume many others are like you...or half expect me to post something that will get me banned ;)

Its becoming clear with my latest encounters with "programmers" that not alot of people take the time to actually plan things out for scalability. They just seem to hack together code and pray it works when there is more then 5 people using it.

Its a major reason twitter always crashes, and facebook randomly just brings up blank pages. Not to mention youtubes "303" view count, and the massive amount of cache errors.

edit: here is a great example
vevgA.png


Notice the "upload time" and the "upload time"
Pharaoh;4994921; said:
I bought some fish the other day......just sayin....

Glass fish? http://glassfish.java.net/ LOL
 
I'm sorry but I do not give you permission to use my name in this atrocity of a thread. Please change "Jeff" to Phil or something. :)
 
MonsterFishKeepers.com