Developer Guide
This guide is for engineers wiring DSM into a service boundary and deciding how much of the stack they need to expose.
Start With dsm-core
The main integration contract lives in dsm-core:
DsmRuntimeDsmRuntimeBuilderCollectionSpecBuilderLeaseCollectionSpecBuilderCrdtCollectionSpecBuilder- collection handle interfaces such as
DsmRegister,DsmLeaseRegister, andDsmCrdtCollection
Runtime Flow
The typical flow is:
- your application mutates a collection handle
DsmRuntimestamps metadata and records the change- the sync layer replicates deltas over the platform channel
- data-plane repair brings lagging peers back toward the current view
Entity Modeling Rules
- Prefer immutable records.
- Use
withMetadata(...)andwithLeaseState(...)to produce new values. - Keep codecs deterministic.
- Model collection identity explicitly with tenant, application, and collection IDs.
When To Use Which Integration Path
Use standalone wiring when DSM is embedded into a service that already owns its bootstrapping and lifecycle.
Use Spring Boot when your platform model standardizes around property-driven configuration, bean wiring, and lifecycle management.
Testing Guidance
Tests in this repository prefer in-memory collaboration over mocks. Before inventing new scaffolding, look at:
FakeClusterMembershipRuntimePlatformSyncService- the integration harnesses in
dsm-integration-test
Best References In The Repository
dsm-examplesfor runnable standalone and Spring Boot examplesTwoNodeIntegrationTestfor register replication across nodesRuntimeIntegrationTestfor broader register, lease, and CRDT coverage