Replication architectureWith EntropyDB, you can replicate data between database instances automatically. For example, one instance can be on a mobile device and another one on a desktop computer. The replication mechanism ensures that the contents of the database is synchronized all the time. A database instance (secondary) can share data with one instance only (primary). However, more secondary database instances can communicate with one primary instance. If you would like an instance of EXContainer to provide its contents to other database instances over the Internet, you must use the method allowMessagingOnPort: (typically, this primary database instance will be running on a server with a permanent network connection). A local database instance of EXContainer (typically on a mobile device) can synchronize its contents with a server database instance by using the method synchronizeWithPort:host:. Important: Only descendants of EXSharedObject which provide encodeWithCoder: oder initWithCoder: can be synchronized among database instances. DelegatesUse the method setDelegate: of EXContainer to set a delegate object which will be notified when an object has been updated or removed in the local database instance; the delegate will receive the message didReceiveUpdate: or didReceiveDeletion:, respectively. The argument of the message is the updated or removed object.
|