The current state of eventually-postgres is pretty bad, being disabled after #81 has been merged.
Things that are currently missing in the crate:
Schema for Aggregates and Events
The database should potentially support a multi-Aggregate setup, so the proposed tables layout looks like this:
Aggregate Types
Contains all the Aggregate types definition in a centralized place.
| Column Name |
Description |
id |
Type identifier of the Aggregate -- might use type_name |
offset |
Global offset of the $all stream. |
Aggregates
Contains all the Aggregates created by the application.
| Column Name |
Description |
id |
Aggregate ID -- should be unique and a string. |
aggregate_type_id |
Reference to the aggregate_types table. Useful for accessing the Aggregate Type offset. |
version |
Last version of the Aggregate. |
Events
| Column Name |
Description |
aggregate_id |
Reference to the aggregates table. |
version |
Version of the Event, for Optimistic Concurrency. |
sequence_number |
Value of the Global Offset at the time of insert -- useful for $all streams publishing idempotency. |
event |
Contents of the event -- should be a JSON. |
Notes
(aggregate_id, version) should be unique.
The current state of
eventually-postgresis pretty bad, being disabled after #81 has been merged.Things that are currently missing in the crate:
NOTIFY/LISTENfor creating persistent streamsSchema for Aggregates and Events
The database should potentially support a multi-Aggregate setup, so the proposed tables layout looks like this:
Aggregate Types
Contains all the Aggregate types definition in a centralized place.
idtype_nameoffset$allstream.Aggregates
Contains all the Aggregates created by the application.
idaggregate_type_idaggregate_typestable. Useful for accessing the Aggregate Type offset.versionEvents
aggregate_idaggregatestable.versionsequence_number$allstreams publishing idempotency.eventNotes
(aggregate_id, version)should be unique.