-
Notifications
You must be signed in to change notification settings - Fork 15
Home
Eveneum is a simple, developer-friendly Event Store with snapshots, backed by Azure Cosmos DB.
var database = "Eveneum";
var collection = "Events";
var client = new CosmosClient("connection-string");
var databaseResponse = await client.CreateDatabaseIfNotExistsAsync(database);
var containerResponse = await databaseResponse.Database
.CreateContainerIfNotExistsAsync(new ContainerProperties(collection, "/StreamId"));
IEventStore eventStore = new EventStore(client, database, collection);
await eventStore.Initialize();
var streamId = Guid.NewGuid().ToString();
EventData[] events = GetEventsToWrite();
await eventStore.WriteToStream(streamId, events);
await eventStore.CreateSnapshot(streamId, 7, GetSnapshotForVersion(7));
var stream = await eventStore.ReadStream(streamId);
Check Quick Start for more info.
The aim of the project is to provide a straightforward implementation of Event Store by utilising the features of Azure Cosmos DB.
The library benefits from automatic indexing, replication and scalability offered by Cosmos DB.
- Ability to store and read stream of events in a single method call. The library will handle retries and batching,
- Ability to store and read snapshots, including support for reading a snapshot and only consecutive events,
- Ability to customize the schema of documents stored in Cosmos DB to allow for rich querying capabilities,
- Built-in optimistic concurrency checks,
- "Cosmos DB Change Feed"-friendly design to enable building independent projections using Change Feed.
Current major version of Eveneum is 6.x. It uses Cosmos DB SDK 3.35.4 and supports transactional writes. This version is actively worked on and should be a default choice for new projects.
Those major versions use Cosmos DB SDK 3.1.1. Please consider upgrading to 4.x as there are no breaking changes in API.
The support for non-partitioned collections in Cosmos DB has been removed in version 2.x, as the non-partitioned collections are being retired from Cosmos DB. If you need to support non-partition collections, please use version 1.x.
This version uses Cosmos DB SDK 2.x and supports both partitioned and non-partitioned collections. This version is not actively maintained with only bug-fixes being considered.