This project aims to prototype event store via web api.
It's about ensuring that all changes made to the application state during the entire lifetime of the application are stored as a sequence of events.
The Marten library provides .NET developers with the ability to easily use PostgreSQL database engine with JSONB support to expose an ACID-compliant event store.
If you have Docker installed you can just double-click run-app.sh .
Start the app and execute a POST request to the /api/UpcomingEvents/receive endpoint.
Then with the same 'identifier' value execute a POST request to the /api/UpcomingEvents/flag
If we now go to the pgAdmin and check the tables in the 'event-store', they should look like:
In the 'mt_streams' table , there should be only a since record with the provided by us ID and version 2.
In the 'public.mt_events' table, there should be 2 records (for each event that we have registrated).
In the 'mt_doc_upcomingeventview' table, there should be a single record with the current state of our aggragate.
Example : Transactional use cases (saga pattern)
In summary, modern systems have more and more such cases, where they receive a message via HTTP, AMQP, etc and then several components are responsible to process this message. In this case, they need to track the progress of the message and have a fluent log of what went wrong.