Skip to main content

Sync coordination layer using Merkle DAG, event sourcing, and CRDTs

Project description

Sync Coordination Layer

A Python sync coordination engine that orchestrates synchronization between distributed nodes using vector clocks, operation logging, and conflict resolution with last-write-wins semantics.

Features

  • Vector Clocks: Full causality tracking across distributed nodes
  • Operation Logging: Persistent SQLite-backed operation log
  • Conflict Resolution: Automatic last-write-wins with vector clock tie-breaking
  • Entity CRUD: Create, update, delete, and merge operations
  • Remote Sync: Synchronize operations between multiple nodes
  • State Export: Full state export for backup and transfer
  • Thread-Safe: Reentrant lock protection for concurrent access

Installation

pip install sync-coordination

Usage

from sync_coordination import SyncCoordinator, OperationType

# Initialize nodes
node1 = SyncCoordinator("node-1", "./sync_store_1")
node2 = SyncCoordinator("node-2", "./sync_store_2")

# Create entity on node 1
op = node1.create_operation(
    OperationType.CREATE, "user:1",
    {"name": "Alice", "email": "alice@example.com"}
)
node1.apply_operation(op)

# Sync to node 2
result = node2.sync_with_remote([op])
print(result)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sync_coordination-1.0.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sync_coordination-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file sync_coordination-1.0.0.tar.gz.

File metadata

  • Download URL: sync_coordination-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for sync_coordination-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7a3269084df8fb0e355bfa930c083f2af86e240901c64576fcb0a7883ae3ff79
MD5 4952aa9473e724b01a1786d23d24a2aa
BLAKE2b-256 18b9f2d6bcf024eb410f87356cfccd203c0d70ac566d93b70ef3c6cdb059cf33

See more details on using hashes here.

File details

Details for the file sync_coordination-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sync_coordination-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac4b9b9df2aa71e6ad1b9dcbdb421e37689e50c81a49d94041bb15ed283607dc
MD5 96134a854821bfe1f25398406e3c458f
BLAKE2b-256 1802a76897cd9eb6653801b4a208e885eade0d4b6b1919031c70ffa3d80a2a84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page