The @protocol synchronization

By Muralidharan Padmanaban, Naresh Gurijala and Intiser Ahmed

Heading with title

What is synchronization?

Commit Log

Real-time Synchronization in the @protocol

Sync from device to secondary server.

Diagram 1.1 depicts synchronization from a local device to a server.
Diagram 1.1 depicts synchronization from a local device to a server.
Diagram 1.1 depicts synchronization from a local device to a server.

Sync from secondary server to device

Let’s describe a use case: @alice has two devices. One device is offline, and the other is online. On both devices, the latest commit ID is 2. On device #2, which is online, @alice updates her location value as ‘california,’ creating a new key-value pair. The @pp syncs this key from device #2 to the server, updating the server’s commit ID with the latest value, 3. Now, device #1, which was offline, comes back online. The latest commit ID in this device is 2, whereas the latest commit ID on the server is 3. To resolve this discrepancy, the @pp updates device #1 with the unsynced key, adding a commit entry. After synchronization, both device #1 and device #2 should have 3 as their latest commit ID.

Diagram 1.2 depicts synchronization from a server to a local device.
Diagram 1.2 depicts synchronization from a server to a local device.
Diagram 1.2 depicts synchronization from a server to a local device.

Syncing only @pp specific data

Diagram 2.1 depicts the steps that take place during an @pp specific sync.
Diagram 2.1 depicts the steps that take place during an @pp specific sync.
Diagram 2.1 depicts the steps that take place during an @pp specific sync.
Diagram 2.2 shows what happens when all @pp keys are synced together.
Diagram 2.2 shows what happens when all @pp keys are synced together.
Diagram 2.2 shows what happens when all @pp keys are synced together.

Device offline sync

Let’s describe a use case: @alice’s mobile device goes offline. After that, @alice adds her email address, which is saved on @alice’s mobile device as a key-value pair without any commit ID. When @alice’s device comes back online, a manual sync is triggered, sending an update command to the server, which in turn responds with a commit ID. The commit ID returned by the server is then updated on the local commit log on @alice’s device, ensuring that the device and server are in sync.

Diagram 3.1 explains what happens during an offline sync.
Diagram 3.1 explains what happens during an offline sync.
Diagram 3.1 explains what happens during an offline sync.

Data Resiliency in the @protocol

Performance considerations

Authors

Murali Dharan (murali@atsign.com) is a Backend Developer for The @ Company

Naresh Reddy Gurijala (naresh@atsign.com) is a Senior Software Engineer for The @ Company

Learn more about The @ Company from our GitHub repo.

Now for some Internet Optimism