P2P Synchronization of Shana Servers
by Hasanat Kazmi for Sahana
Syncing Sahana Servers has been discussed recently on sahana-dev. It is basically about syncing different instances of Sahana server which have been deployed by an organization. Syncing two Sahana servers is basically about syncing their databases. It cannot be simple database dump because we also have different database semantics at SahanaPHP and SahanaPy. So first I'll create a module in SahanaPy which exports database as in SahanaPHP. The idea is to build upon presently exporting mechanism. I will also extend Synchronization module in each Sahana server to add automatic synchronization by adding a new feature called 'Sync Pool' (As shown in diagram). It will basically list all those pools which that instance of Sahana belongs to. A user (admin) can join new pools, edit the relationship with different pools (like type of data to import, time lag for each sync attempt etc). Software which implements Zero Configuration runs continuously in the background. It has a search mechanism which is implemented by two tasks, 1: It exposes services with the name of all those pools which the instance of Sahana has subscribed to. 2: It 'searches' all those Sahana instances which have also subscribed to its pools. Once it finds servers which are in the same pool as it is, it fetches their database using Synchronization methodologies currently present (HTTP GET/POST). User can also specify server by IP/URL. Then it parses the XML and adds unique records in the database. At the time of installation, software needs to know administrative password of database.