19.1 Database replication
The most general way to replicate a database is to use the update
log. 9.2 The update log. This requires one database that acts as a master
(to which data changes are made) and one or more other databases that act
as slaves. To update a slave, just run
If you never delete anything from a table, you can use a It is possible to make a two-way updating system using both the update log (for deletes) and timestamps (on both sides). But in that case you must be able to handle conflicts when the same data have been changed in both ends. You probably want to keep the old version to help with deciding what has been updated. Because replication in this case is done with SQL statements, you should not use the following functions in statements that update the database; they may not return the same value as in the original database:
All time functions are safe to use, as the timestamp is sent to the
mirror if needed. |