Subject | Re: High resilience, load balanced Firebird & PHP |
---|---|
Author | sergey.mereutsa |
Post date | 2011-03-10T20:41:45Z |
Hi!
I did some kind of master-slave (unidirectional) replication for one project - it is not difficult, just a lot of work.
The idea was very simple - we added additional field (bigint) for all tables in database. This field was updated by trigger with the value of generator (sequence).
Once per day (but it is possible to do once per hour/minute - depends of your tasks) - slave server requested "replica slice" - all fields updated since generator has value XXXX. Data was compressed and send as bz2 archive via http. Trigger on slave database performed simple check via context variable - if inserts/updates/deletes was performed by replicator - it just did nothing. Not rocket science, just a lot of work :)
You can contact me via e-mail, if you want more details.
Serj.
I did some kind of master-slave (unidirectional) replication for one project - it is not difficult, just a lot of work.
The idea was very simple - we added additional field (bigint) for all tables in database. This field was updated by trigger with the value of generator (sequence).
Once per day (but it is possible to do once per hour/minute - depends of your tasks) - slave server requested "replica slice" - all fields updated since generator has value XXXX. Data was compressed and send as bz2 archive via http. Trigger on slave database performed simple check via context variable - if inserts/updates/deletes was performed by replicator - it just did nothing. Not rocket science, just a lot of work :)
You can contact me via e-mail, if you want more details.
Serj.