4.5. LDAP Database Replication

Once the users database were created, and mailboxes had been evenly split among different servers, we still had to solve a major problem: where do we keep the database? On which server? Well, of course on ALL of them! :) Actually OpenLDAP allows us to split the database in how many parts we like, and to replicate the different parts in different ways, but at this stage of the project we thought it was better to just replicate the full database on each server.

OpenLDAP replication can be deployed in many ways: the easiest one implies a master and several slaves. The database updates are made on the master server and they get forwarded to all of the slaves; at the same time the request of new activation or updates can be made at any given slave, and it will know how to communicate to the master server the request that will then provide for the update. If the master server is attacked by a fleet of grasshoppers or some other kind of major shit happens to it, the configuration of the other servers will allow us to select immediately a new master server with a one-line change in the configuration: in this way the whole system will continue to work.