An application showing the absolute basics of event sourcing with EventStoreDB (ESDB).
The accompanying YouTube video can be found here.
This effort was inspired by Nick Chapsas' excellent video about getting started with Event Sourcing in .NET. This version however uses EventStoreDB as its database.
Be sure to check out Nick's YouTube channel if you are somehow unfamiliar with his content, as well as his education platform Dometrain where you can level up your software development skills!
This is not an Architectural Decision Records (ADRs) log. This is just a tribute 🎶🎸.
2024-May-21
- For clarity, renamed the .NET console application projects.2024-May-21
- Updated some code, fixed some bugs and typos. - Decided this repository will have multiple versions. - One that works nearly the same as Nick's original in-memory incarnation. - Another using ESDB and some of the most frequently used commands with the ESDB .NET client. - Could have a potential third version if there is some demand from the community. - Would appreciate feedback. That and questions could extend this even further, perhaps.2024-May-20
- Watched Nick's initial video. Awesome. Wait, what if we did the same thing, but with ESDB? - Made this code repository and .NET solution. - Only the bare bones as of this commit. Will update to include some event sourcing best practices without "getting into the weeds" too much.Like the other programs that are .NET console application, the database is a glorified key-value store that's in-memory.
To run it, enter the project directory through your shell's associated Change Directory (cd
) command from the solution root, such as:
cd .\StudentEnrollment01.InMemory
dotnet build
dotnet run
Alternatively, you can do all this from the solution's root by targeting the project with --project
and run
it immediately, such as:
dotnet run --project .\StudentEnrollment01.InMemory\StudentEnrollment01.InMemory.csproj
While still a .NET console app, we're now going to use the Event Store database. So be sure to launch EventStoreDB through Docker. With a terminal / command prompt execute:
docker-compose up
NOTE: You will need to have ESDB running via Docker for the third (03) project as well.
Like before, you can change directory into the project or run it from the root.
Run the console application of your choice, change direction to that particular project directory and then execute:
cd .\StudentEnrollment02.Esdb
dotnet build
dotnet run
Or alternatively:
dotnet run --project .\StudentEnrollment02.Esdb\StudentEnrollment02.Esdb.csproj
Instructions will go here, but will basically be the same as above!
Erik Shafer (me):
- event-sourcing.dev - Blog, presentations, contact information
- youtube.com/@event-sourcing - YouTube channel
Nick Chapsas:
- youtube.com/@nickchapsas - YouTube channel
- Dometrain - Courses crafted by real engineers for the real world.
To Be Determined.
This is done in the open to help educate. Don't be a jerk. Etc. :)