you can use GUID for the primary key. the harshing function it uses makes it impossible for having the same primary key across any of your 10 sites
A globally unique identifier or GUID (pronounced /ˈɡuːɪd/ or /ˈɡwɪd/) is a special type of identifier used in software applications to provide a unique reference number. The value is represented as a 32 character hexadecimal string, such as {21EC2020-3AEA-1069-A2DD-08002B30309D} and usually stored as a 128 bit integer. The term GUID usually, but not always, refers to Microsoft's implementation of the Universally Unique Identifier (UUID) standard.
The primary purpose of the GUID is to have a totally unique number. Ideally, a GUID will never be generated twice by any computer or group of computers in existence. The total number of unique keys (2128 or 3.4×1038 - in relation there are about 1.33×1050 atoms on earth) is so large that the probability of the same number being generated twice is extremely small, and certain techniques have been developed to help ensure that numbers are not duplicated. See the algorithm section below for more on this subject.
I hadn't thought of that, the PK integrity given more than two DBs. Let me do some more research. Thanks for pointing that out.On Thu, Dec 16, 2010 at 10:53 AM, Chris Mwirigi <mwirigic@gmail.com> wrote:
I have implemented a master-master replication setup across 2 DB's and have no complaints so far, (Network outage is not an issue so each instance is 0 sec's behind the master at all times)
i am interested to find out how you would maintain PK integrity when using more that 2 databases
in my setup, i have one DB writing PK's in evens and the other writing them in odds and this preserves their integrity. Extending this to > 2 DB's, i don't know. it might be something worth looking into
Regards
ChrisOn Thu, Dec 16, 2010 at 10:11 AM, Peter Karunyu <pkarunyu@gmail.com> wrote:
_______________________________________________Has anyone implemented MySQL replication for a mission critical application? I seek opinions of skunks who have "trode" this path, no need to make the same mistake twice.
My goal is to make a certain LAMP app be available to offices in 10 different towns even when the network is non-existent. My chosen solution is a master-master replication of the database in all the 10 offices. (This takes care of the network going down). So each office users access the app in hosted in their local network, the app works with the local replica, thus making it "seem" faster.
For each office, I am thinking of using DRDB and Heartbeat to have redudant instances of the replicas on standby, in an active/passive configuration. (This creates redudancy in each office).
And since budget is non-existent, I will be using normal PCs with a bit more RAM.
My primary concern is the master-master replication, will it work in real life as it does in theory especially when the network is unavailable for extendend periods of time?
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke