[−][src]Crate cqrs_es
srvrls - a lightweight serverless framework
cqrs
A lightweight, opinionated CQRS and event sourcing framework targeting serverless architectures.
Installation
cqrs-es is available from Crates.io or Github.
[dependencies]
cqrs-es = "0.0.9"
Or for a specific branch
[dependencies]
cqrs-es = { git = "https://github.com/serverlesstechnology/cqrs.git", branch = "master"}
Opinions
- Aggregate persistence is via event sourcing only.
- Metadata is implemented only as a
HashMap<String,String>
. Further, theMetadataSupplier
that the user provides has no insight into the event or aggregate that it supplies metadata for. This may be changed. - JSON serialization only.
- Generics are preferred over boxed traits.
- Persistence is implemented through a Postgres database.
Todos/research
- Event upcasters.
- Some additional framework around
GenericViewRepository
to simplify event replay. - Explore options for increasing the usefulness of
MetadataSupplier
. - Event serialization uses the event type as the root node of the JSON tree. This simplifies deserialization but is non-standard.
- Paging for PostgresEventStore
- Persistence implementation for DynamoDb.
Modules
mem_store | An in-memory event store suitable for local testing. |
test | Test provides a test framework for building a resilient test base around aggregates. |
tools | Tools provides a simple postgres view repository to simplify loading and updating views. |
view | View provides the basic downstream query objects needed to render queries (or "views") that describe the state of the system. |
Structs
CqrsFramework | This is the base framework for applying commands to produce events. |
MessageEnvelope |
|
NoopMetadataSupplier | A simple |
PostgresStore | Storage engine using an Postgres backing. This is the only persistent store currently provided. |
TimeMetadataSupplier | A simple |
UserErrorPayload | Payload for an |
Enums
AggregateError | The base error for the framework. |
Traits
Aggregate | A trait that defines an |
Command | A |
DomainEvent | A |
EventStore | The abstract central source for loading past events and committing new events. |
MetadataSupplier | A |