ReplicaId

@Serializable
value class ReplicaId(val value: String)

Identity of one replica (peer) in a CRDT. Used to namespace Dots so every operation gets a globally-unique name with no coordination and no clock.

Precondition — uniqueness across all replicas. A ReplicaId identifies one logical replica for its entire lifetime. Two replicas (peers) MUST have distinct ReplicaIds. Reusing the same value for two peers — even across sessions — corrupts every causal CRDT: their dots collide, making the merge treat two unrelated events as the same event, producing wrong results with no runtime error.

Choose a stable identifier (a UUID, device serial, or similar) at replica creation and keep it for the peer's lifetime. Never derive a ReplicaId from a counter that can wrap or restart.

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard