Skip to content
SafeMesh

Merge illustrations

Build apps that work offline and merge shared data when they reconnect with SafeMesh, from Rust, TypeScript/JavaScript via WASM, Python or C. Each language path has its own scope.

These illustrations explain independent edits and repeated delivery. For a running counter, return to the homepage; for failure modes, open the Lab.

Edited apart. Same checklist together.Field crew · illustration · both edits kept

1. Offline

Three copies. The crew adds two checklist entries.

Device A✓ Pump checked
Device B! Valve leaking
Device CNo entries yet

2. Reconnect

The app delivers both entries to every device.

A ↔ B ↔ C Share “Pump checked” + “Valve leaking”

3. Same everywhere

All three lists match. Neither addition is lost.

Device A✓ Pump checked! Valve leaking
Device B✓ Pump checked! Valve leaking
Device C✓ Pump checked! Valve leaking

Illustration of two additions to a shared set, not a running integration. Your app supplies delivery and storage. For the real Rust/WASM behavior, open SafeMesh Lab ↗.

Inside the sync · G-Counter

Share counts. Don’t count them twice.

A counted 2. B counted 3. C counted 0. Each replica keeps the largest count seen for each source, then adds those counts: 2 + 3 + 0 = 5.

Three replicas share G-Counter coordinatesAfter exchange, replicas A, B and C each store A:2, B:3, C:0, giving total 5. Messages carrying A:2 and B:3 travel through the mesh. Repeated delivery leaves the total unchanged.Replica AA:2 · B:3 · C:0Total 5Replica BA:2 · B:3 · C:0Total 5Replica CA:2 · B:3 · C:0Total 5A:2B:3A:2Total stays 5

Shown after all counts arrive. Messages can travel again; merging the same counts does not add them again. Illustration of the data rule; your app supplies delivery and storage.