Skip to content

Latest commit

 

History

History

introduction_to_event_sourcing

Twitter Follow Github Sponsors blog blog

Introduction to Event Sourcing Self-Paced Kit

Event Sourcing is perceived as a complex pattern. Some believe that it's like Nessie, everyone's heard about it, but rarely seen it. In fact, Event Sourcing is a pretty practical and straightforward concept. It helps build predictable applications closer to business. Nowadays, storage is cheap, and information is priceless. In Event Sourcing, no data is lost.

The workshop aims to build the knowledge of the general concept and its related patterns for the participants. The acquired knowledge will allow for the conscious design of architectural solutions and the analysis of associated risks.

The emphasis will be on a pragmatic understanding of architectures and applying it in practice using EventStoreDB.

You can do the workshop as a self-paced kit. That should give you a good foundation for starting your journey with Event Sourcing and learning tools like EventStoreDB.

If you'd like to get full coverage with all nuances of the private workshop, check training page on my blog for more details feel free to contact me via email.

Read also more in my article Introduction to Event Sourcing - Self Paced Kit.

Exercises

Follow the instructions in exercises folders.

  1. Events definition.
  2. Getting State from events.
  3. Appending Events:
  4. Getting State from events
  5. Business logic
  6. Application logic:
  7. Optimistic Concurrency:
  8. Projections:

Prerequisites

  1. Install git - https://git-scm.com/downloads.
  2. Clone this repository.
  3. Install Node.js 20.10 - https://Node.js.org/en/download/ (Or better using NVM).
  4. Install VSCode, WebStorm or other prefered IDE.
  5. Install docker - https://docs.docker.com/engine/install/.
  6. Open the current folder in IDE.

Setup

  1. Install NPM packages by running: npm install.
  2. Build source codes: npm run build.
  3. If you're using VSCode, you may consider importing profile from the ./.vscode/Node.js.code-profile to get all recommended plugins.

Ensuring that all is setup correctly

  1. Run: docker-compose up to start EventStoreDB docker image.
  2. Run npm run test:solved. If all is fine then all tests should be green.

Running

  1. Run: docker-compose up to start EventStoreDB docker image.You should automatically get EventStoreDB UI: http://localhost:2113/
  2. You can get build watch by running npm run build:ts:watch.
  3. To run test for exercises run npm run test:exercise. For solutions run npm run test:solved, for all npm run test.
  4. Whe you're working with exercise and want to have tests running on file change run npm run test:exercise:watch.