Hi everybody, this is my first post in forums. I have a question, and maybe someone could help me. Can SilverStripe work with MySQL multimaster replication? MySQL allows replicate several copies of same database in "circular" way (master/master). To prevent a primary key value "collision", MySQL has two parameters to avoid this ('auto_increment_offset' and 'auto_increment_increment'). Happily, all SilverStripe tables has primary keys configured as "autoincremental" (very few CMS have this feature). Therefore, if each MySQL server is properly configured, no primary key collision should be occurs. However, i'm not sure this is enough to conclude that a SilverStripe installation replicated in several MySQL servers will works safely. The idea is use a LVS director to assign connections (with persistance) to several Lighttpd servers, each connected to a different replicated MySQL database. Someone knows if this is possible? Thanks in advance!
I can think of no reason why it wouldn't work in such an environment, but we've never tested it ourselves. I can confirm that SilverStripe respects the offset/increment settings that you've listed.
I would say that it is sufficiently likely to work to warrant experimentation, so I suggest that you set up a site and let us know how you get on!
Hi Sam, thanks for your quick reply. I will try to prepare a test installation this week and then post results. Thanks again!
Hi, finally I prepare an environment to test multimaster replication with SilverStripe. I create 6 virtual machines (with VirtualBox 1.6.0). Every VM have Debian 5.0 (Lenny) Beta 2 installed (with kernel 2.6.24-1-686).
Clients and servers reside in separated private networks. Clients connect to a LVS director (version 1.24, ipvsadm --version).
The LVS director expose a virtual IP 10.0.0.99 via NAT mode, with persistance. The three real servers have installed Lighttpd 1.4.19 (with rewriting rules), and MySQL 5.0.51 (configured with multimaster replication). The three machines have SilverStripe 2.2.2 sources deployed in web server root directory (/var/www in Debian) and a empty database created in each MySQL server.
I use one client (192.168.0.2) to install SilverStripe through virtual IP (http://10.0.0.99/install.php). LVS assign this connection to one real server and installation begins. After installation, I have three exactly copies of SilverStripe database (both structure and data) and could edit content from client without problems.
After, I use rsync 3.0.3 to sinchronize web server root directory to other webservers (and create /var/www/mysite/_config.php).
Later, I test connection of a client to a different web server (and to a replicated database) and SilverStripe works smoothly.
At first glance, everything looks ok, but much more testing are needed, specially in concurrent edit situations and data cachÃƒÂ© utilization.
Attached to this post is an ASCII diagram of network configuration used in test.
Oops, i forgot upload file :)