Open Source Distributed Coordination
Distributed Shared Memory for Enterprise Java Services
DSM gives service teams a runtime-first coordination layer for replicated registers, lease-backed ownership, and CRDT state. It is built for control-plane data, not for turning every service into a database platform.
- Registers, leases, and CRDTs in one runtime surface
- HMAC signing, replay protection, and admission validation
- Spring Boot and standalone wiring built around the same API
Replicate routing hints, feature flags, and control-plane metadata with deterministic runtime registration and explicit collection boundaries.
- Best for shared metadata
- Explicit tenant/application/collection IDs
- JDK-only runtime core
DsmRuntime runtime = DsmRuntimeBuilder.builder()
.clusterId("prod-cluster")
.serviceId("gateway-service")
.membership(membership)
.build();
runtime.register(CollectionSpecBuilder.<RouteHint>register(
"shared",
"gateway",
"route-hints")
.schemaId("route-hints/v1")
.codec(new RouteHintCodec())
.build());Platform highlights
A runtime surface built for control-plane data, not platform sprawl.
DSM focuses on the problems enterprise teams actually have to solve: metadata replication, shard ownership, consistent routing, and observability that matches operational reality.
Multi-Model Collections
Registers, lease collections, and CRDT collections share one runtime contract so teams can choose the right consistency primitive per workload.
High Availability
Runtime sync, anti-entropy repair, crash recovery, and graceful shutdown flows are designed for long-lived production clusters.
Enterprise Security
HMAC message signing, replay protection, and admission validation protect replication channels without forcing a heavyweight stack.
Flexible Clustering
Choose standalone, multicast, or unicast gossip membership based on your deployment topology and trust boundaries.
Spring Boot Integration
Starter and autoconfiguration modules expose the runtime facade and collection handles with explicit YAML configuration.
Built-in Observability
Runtime diagnostics and the DsmMetrics SPI give platform teams visibility into cluster size, sync latency, lease activity, and backpressure.
Enterprise workloads
Use DSM where coordination data matters more than raw storage volume.
DSM is a strong fit for routing metadata, ownership coordination, distributed counters, and service-local control-plane state that still needs multi-node replication.
Service Discovery & Routing
Replicate route hints and gateway metadata across nodes so request steering stays locally fast while updates propagate through the DSM runtime.
Matches the route-hints register example in the standalone runtime sample.Leader Election & Sharding
Lease collections coordinate shard ownership with autonomous renewal and fencing-aware handoff for workers that need a single active owner.
Backed by the shard-owner lease example and the runtime lease diagnostics surface.Configuration Distribution
Push lightweight operational configuration and feature state across a service family without turning the runtime into an application database.
Fits DSM register collections where tenant, application, and collection boundaries stay explicit.Cluster-Wide Metrics Aggregation
Use CRDT collections for counters and convergent state so each node can update locally while the cluster repairs toward a consistent view.
Modeled on the request-counter CRDT example in the runtime sample factory.From API to operations in three steps
Model the collection once, then keep the same runtime path through production.
DSM keeps collection modeling, runtime wiring, cluster sync, and operator-facing diagnostics aligned.
Define
Register collections through a runtime-first API where tenant, application, and collection IDs are explicit instead of hidden behind framework magic.
CollectionSpecBuilder.<RouteHint>register(
"shared",
"gateway",
"route-hints")
.schemaId("route-hints/v1")
.codec(new RouteHintCodec())
.build();Deploy
Wire DSM directly or let the Spring Boot starter assemble the runtime, membership, and configured collection handles from application properties.
dsm:
cluster-id: runtime-example
service-id: gateway-service
cluster:
mode: unicast
collections:
- bean-name: routeHintsCollection
tenant-id: shared
application-id: gateway
collection-id: route-hints
type: REGISTER
codec-bean: routeHintCodecOperate
Read runtime snapshots, cluster membership state, lease-specific diagnostics, and metrics callbacks without bolting on a second observability model.
RuntimeDiagnostics diagnostics = runtime.diagnostics();
int totalEntries = diagnostics.totalEntries();
ClusterView clusterView = diagnostics.clusterView();
List<CollectionDiagnostics> collections = diagnostics.collections();
List<LeaseCollectionDiagnostics> leaseCollections = diagnostics.leaseCollections();Start in minutes
Choose the integration path that matches your service boundary.
The same runtime contracts support direct Java wiring for embedded services and explicit Spring Boot configuration for platform-standard deployments.
Maven dependency
<dependency>
<groupId>com.leanowtech.dsm</groupId>
<artifactId>dsm-core</artifactId>
<version>${dsm.version}</version>
</dependency>Minimal runtime
DsmRuntime runtime = DsmRuntimeBuilder.builder()
.clusterId("runtime-example")
.serviceId("gateway-service")
.membership(new StandaloneClusterMembership(self))
.build();
runtime.start();Module architecture