Push/pull mechanism and dependency fetching

Yamm is network oriented. Objects fetching is base on a push/pull mechanism. This push/pull mechanism relies on a custom DataSync module job.

Server pushes the synchronization order to the client, client responds OK if it is ready. Then, it creates the DataSync job. DataSync is scheduled using the Drupal hook_cron(), and will launch a PHP CLI thread on system which will launch the custom job.

The job when created will pull the server the main data to synchronize (the objects referenced by your custom views) N times, until all objects have been sent. During pulling, server will create an Entity abstraction object for each piece of data, serialize it, and send it to the client.

Until the network pulling stays unfinished, the client, with the help of the EntityParser which will iterate over all entities, and will create a dependency tree recursively, pulling the server again for each new sub tree it finds.
During this parsing operation, the Yamm_EntityParser will also check for circular dependencies, and will not allow the same object to be saved or updated twice.

Push/Pull sequence schema

Incremental updates

During the process, the main data which allow Drupal sites to synchronize is passed through the Yamm_Entity object, it's a standard V4 UUID. Each Drupal supported object will have its own generated UUID on server, whatever its type is. These UUID, server generated are stored into the Yamm_Entity object, and will help the client to know, for each object it processes, if he has to create a new one, or update an existing one.

Both client and server store their own UUID registry. The server stores the UUID it generates, the client stores the UUID the server gave him.