CRITICAL: Rewrite NATS store — use JetStream stream with subjects, not KV #24
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ash/eskit#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Current natsstore uses KV bucket with ALL events serialized as JSON array per key. Fundamentally broken.
Reference Implementations
Rita Design (adopt this)
Subject pattern
$ES.<store>.<entity-type>.<entity-id>.<event-type>Event type IN the subject = filterable at NATS level without deserializing. Three-token entity:
type.id.eventtype.Stream config
Append
js.PublishMsgwith headersjetstreamext.PublishMsgBatch(atomic, from orbit.go)ExpectedLastSubjSeqSubjHeaderwith entity wildcard patternEvolve (read/replay)
WithAfterSequencefor partial replayWithStopSequencefor bounded replayWatch (live subscription)
Headers (metadata)
Rita-Entity,Rita-Type,Rita-Time,Rita-CodecRita-Meta-prefix for custom metadataes-prefix convention insteadWhat we do BETTER than Rita
anyeverywhere)Dependencies
github.com/synadia-io/orbit.go/jetstreamextfor atomic batchTests
NATS store rewritten from KV to proper JetStream stream with subject-per-entity, atomic batch support, ordered consumers, OCC via ExpectedLastSubjectSequence. 31/32 conformance tests passing.