Command persistence middleware for production debugging #114
Labels
No labels
bug
documentation
enhancement
investigation
nice-to-have
performance
production-ready
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ash/eskit#114
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?
Summary
Add a middleware that persists every command sent through the CommandBus, capturing the full lifecycle: intent → decision → resulting events.
Nobody in Go ES does this. Axon (Java) has it and it's their strongest enterprise selling point. We'd bring enterprise-grade observability to Go event sourcing.
Philosophy: Bricks, Not Cathedrals
eskit is a toolkit of composable bricks. Users pick the pieces they need and assemble them. Command persistence follows the same principle:
CommandLogStoreis the contract. We provide implementations, but users can bring their own (Redis, DynamoDB, flat files, whatever).WithCommandAudit(bus, store)works with ANYCommandLogStoreimplementation.What gets stored
API
Provided Backends (Bricks)
commandlog/memlog/— for testing and devcommandlog/sqlitelog/—command_logtable, indexed on correlation_id, command_type, timestampcommandlog/pglog/—command_logtable, same indexes, JSONB for payload/metadatacommandlog/natslog/— dedicated JetStream stream, KV for lookupsEach backend is its own Go sub-module (same pattern as event stores). Users import only what they need.
Custom Backends
Users who want a backend we don't provide just implement
CommandLogStore. The conformance test suite (commandlogtest/) is exported so they can verify their implementation passes all requirements.Testing Requirements
commandlogtest/) — shared tests ALL backends must pass, exported for custom implementations-race)Benchmark Requirements
Why
Build order
This should be built FIRST — small surface area, immediately useful, and both CLI and UI depend on it.