How to build an event store using CosmosDB

Опубликовано: 02 Май 2026
на канале: dotnetFlix
4,957
64

Event Sourcing is nothing more than storing current state as a series of events and rebuilding system state by replaying that series of events. Cosmos DB, the multi-model globally distributed database service on Azure is a great fit for implementing event sourced systems.

In this episode, Sander Molenkamp will show you how to build an event store on Cosmos DB. Topics include bulk operations using stored procedures, adding a domain layer, and projections using the Cosmos DB Change Feed. All while being globally-distributed, and without deploying or managing any servers.

00:00:10 - Introduction
00:01:20 - Case: Energy Insights project
00:05:00 - Storing current state vs Event Sourcing
00:08:15 - Let’s build an Event Store!
00:11:35 - Demo: Working with streams
00:21:28 - Demo: Adding a domain layer
00:32:03 - Querying event streams
00:37:10 - Demo: Projections
00:45:50 - Wrap up

Demo code:
https://github.com/amolenk/CosmosEven...

This video was made possible by Info Support (https://www.infosupport.com) and DotNed, the Dutch .NET Usergroup (https://www.dotned.nl).

--