jacqueskang/EventSourcing
48.8
Weak · 20 September 2026
2.8k
lines of production code
C#
primary language
4
measurements over time
What this system is
JKang.EventSourcing is a .NET framework that implements the event sourcing pattern, allowing applications to model domain state as a sequence of immutable events. It provides core abstractions for aggregates and snapshots, along with persistence providers for Azure Cosmos DB, AWS DynamoDB, Amazon S3, Entity Framework Core, and the local file system. The system supports efficient state reconstruction through version-aware snapshotting and distributed caching, with a sample gift card application demonstrating its usage.
How it got here
2018 — Initial framework release and persistence support
9 changes.
This period marks the initial release of the JKang.EventSourcing framework, establishing core abstractions for aggregates, events, and snapshots. It introduces dependency injection configuration and implements persistence providers for file systems, EF Core, and other backends. The release also adds snapshot-based rehydration to optimize aggregate loading and updates the event model to include versioning and timestamps.
2019–2020 — Snapshotting infrastructure and multi-provider persistence
14 changes.
This period focused on introducing a comprehensive snapshotting subsystem to optimize aggregate state reconstruction, including version-aware storage and distributed caching support. It significantly expanded the library's persistence capabilities by adding new providers for DynamoDB, Azure Cosmos DB, and local file systems, alongside corresponding testing fixtures and sample applications.
Features
Add AWS S3 snapshot store and S3 persistence mode to the testing web app
The testing web application now supports storing event-sourcing snapshots in Amazon S3. This is enabled by the new \JKang.EventSourcing.Persistence.S3\ package, which provides the \S3SnapshotStore\ implementation and DI extensions. In the \Startup.cs\ of the \TestingWebApp\, a new \PersistenceMode.S3\ option has been added to the configuration switch, allowing users to configure the app to use an S3 bucket (with a specified prefix) for snapshots while keeping the event store in EF Core (InMemory). The \PersistenceMode\ enum and \appsettings.json\ have been updated to reflect this new capability.
src/JKang.EventSourcing.TestingWebApp · high confidence
Add Azure Cosmos DB persistence provider
Introduces a new persistence backend for event sourcing using Azure Cosmos DB. Users can now register the provider via \UseCosmosDBEventStore\, which configures a \CosmosClient\ to store events in a specified database and container. The implementation includes an initializer that automatically creates the database and container (partitioned by aggregate ID) and ensures an index exists on the aggregate version for efficient querying. Events are serialized using Newtonsoft.Json with camel-case property naming and type handling, and the store supports retrieving events by aggregate ID and version range.
src/JKang.EventSourcing.Persistence.CosmosDB · high confidence
Add DynamoDB persistence and snapshotting support
This change introduces a new DynamoDB-based event store and snapshot store for the JKang.EventSourcing library. Users can now configure DynamoDB as the backend for both event persistence and aggregate snapshots via the \UseDynamoDBEventStore\ and \UseDynamoDBSnapshotStore\ extension methods. The implementation handles automatic table creation with configurable names, supports numeric and string aggregate keys, and manages serialization using Newtonsoft.Json with camel-case property naming. The event store supports adding events, retrieving aggregate IDs, and fetching events within a specific version range, while the snapshot store allows saving and retrieving the last snapshot up to a given version.
src/JKang.EventSourcing.Persistence.DynamoDB · high confidence
Add gift card management UI with snapshot and version history
The testing web application now includes a full gift card management interface. Users can create new gift cards, view their current balance and event history, and perform debit transactions. The interface also exposes event-sourcing capabilities, allowing users to manually trigger snapshots and browse previous aggregate versions, with an option to ignore snapshots when viewing history.
src/JKang.EventSourcing.TestingWebApp/Pages · high confidence
Add text-file-based snapshot persistence
Users can now store event-sourcing snapshots in the local file system by configuring a folder path via \UseTextFileSnapshotStore\. The implementation serializes snapshots to individual \.snapshot\ files named by aggregate ID and version, automatically creates the target directory on initialization, and retrieves the latest snapshot by scanning the folder for matching files.
src/JKang.EventSourcing.Persistence.FileSystem/Snapshotting · high confidence
Added Bootstrap 3.3.7 theme assets to the sample web app
The sample web application now includes the Bootstrap 3.3.7 theme files (including CSS, minified CSS, source maps, and metadata) in its static assets folder, enabling the use of Bootstrap's themed UI components for styling buttons, navbars, alerts, and other elements.
samples/Samples.WebApp/wwwroot · high confidence
Added testing fixtures for gift card aggregate with snapshot and caching support
The src/JKang.EventSourcing.TestingFixtures package now includes a complete set of example classes for a GiftCard aggregate, demonstrating how to implement event sourcing with snapshots and distributed caching. This includes the domain events (GiftCardCreated, GiftCardDebited), a snapshot model (GiftCardSnapshot), repository interfaces and implementations (IGiftCardRepository, GiftCardRepository, CachedGiftCardRepository), and the aggregate root itself. The repositories show how to integrate with ISnapshotStore and IDistributedCache, allowing users to see how to load aggregates from snapshots and cache them with sliding expiration.
src/JKang.EventSourcing.TestingFixtures · high confidence
Cosmos DB snapshot persistence support
Users can now persist event-sourcing snapshots to Azure Cosmos DB. This change adds a new snapshot store implementation that stores snapshot data in a Cosmos DB container, initializes the required database and container with appropriate partitioning and indexing policies, and provides DI extensions to register the snapshot store and initializer. The snapshot store supports adding new snapshots and retrieving the last snapshot up to a specific version.
src/JKang.EventSourcing.Persistence.CosmosDB/Snapshotting · high confidence
EF Core persistence for events and snapshots
The \src/JKang.EventSourcing.Persistence.EfCore\ package now provides Entity Framework Core implementations for both the event store and the snapshot store. Users can register these stores via \UseEfCoreEventStore\ and \UseEfCoreSnapshotStore\, which wire up \IEventStore\ and \ISnapshotStore\ against custom \DbContext\ types. The implementation persists events and snapshots as serialized JSON strings in database tables, using a composite primary key of \AggregateId\ and \AggregateVersion\ to ensure uniqueness and ordering. This change introduces the persistence layer for these core domain components, allowing applications to leverage EF Core for durable storage of event-sourced state.
src/JKang.EventSourcing.Persistence.EfCore · high confidence
Initial release of JKang.EventSourcing framework v1.2.1
The JKang.EventSourcing .NET Core event sourcing framework is introduced with version 1.2.1. This release establishes the core solution structure and abstractions, including the \IEventSourcingBuilder\ interface for dependency injection configuration and the \IAggregateOptionsMonitor\ for managing aggregate-specific options. The package is authored by Jacques Kang and includes foundational project references for persistence providers such as EF Core, DynamoDB, Cosmos DB, and S3.
src · high confidence
Introduce file-system-based event store with version-aware loading
The FileSystem persistence module now provides a text-file event store that writes all events for a single aggregate into one file (named by the aggregate key) within a configured folder. Events are serialized using Newtonsoft.Json with camel-case property names and object type handling, and the store supports loading events filtered by a version range (minVersion/maxVersion) so users can retrieve only the events needed to reconstruct a specific aggregate state.
src/JKang.EventSourcing.Persistence.FileSystem · high confidence
Introduce snapshotting infrastructure with version-aware store
The snapshotting subsystem now includes an \AggregateSnapshot\ model that tracks the aggregate ID and version, enabling consumers to load aggregates at specific versions. A default persistence layer has been added, providing \ISnapshotStore\ and \ISnapshotStoreInitializer\ interfaces along with default implementations that support adding snapshots and finding the last snapshot up to a given version. These services are registered via a new \TryUseDefaultSnapshotStore\ extension method on \IEventSourcingBuilder\, allowing users to opt into the default snapshot store implementation for their aggregates.
src/JKang.EventSourcing.Abstractions/Snapshotting · high confidence
Introduces DI registration API for event sourcing
The library now provides a dedicated \AddEventSourcing\ extension method for \IServiceCollection\, allowing users to configure event sourcing via an \IEventSourcingBuilder\. This change introduces the \EventSourcingBuilder\ class and registers the \IAggregateOptionsMonitor\ as a singleton, establishing the foundation for dependency injection-based configuration of aggregate options.
src/JKang.EventSourcing · high confidence
New abstract cached aggregate repository for distributed caching
A new abstract class, CachedAggregateRepository, has been added to the JKang.EventSourcing.Persistence.Caching library. This component extends the standard aggregate repository to integrate with Microsoft.Extensions.Caching.Distributed, allowing aggregates to be stored in and retrieved from a distributed cache. It handles serialization and deserialization of aggregate state (including snapshots and events) using Newtonsoft.Json, and manages cache keys based on aggregate ID and version to optimize read performance.
src/JKang.EventSourcing.Persistence.Caching · high confidence
New domain abstractions for aggregates, events, and snapshots
The domain layer now exposes three new interfaces: IAggregate\<TKey\> defines the core aggregate contract including identity, version, and a GetChangeset method; IAggregateChangeset\<TKey\> encapsulates the pending events and snapshot to be committed; and IAggregateSnapshot\<TKey\> represents the state of an aggregate at a specific version. These interfaces allow for custom implementations of the event sourcing domain model.
src/JKang.EventSourcing.Abstractions/Domain · high confidence
New gift card event-sourcing sample application
The samples directory now includes a complete gift card demonstration built with ASP.NET Core Razor Pages and the JKang.EventSourcing library. This sample introduces a domain model for gift cards that tracks balance and version history through events, persisted via an Entity Framework Core in-memory store. Users can create new gift cards with an initial credit, view their current balance and event history, and debit amounts from the card, with the system enforcing rules such as preventing negative debits and insufficient funds.
samples · high confidence
Behavioural changes
Aggregate rehydration now supports snapshots
The Aggregate base class now accepts a snapshot and a sequence of subsequent events in its constructor, allowing aggregates to be reconstructed from a snapshot rather than replaying the entire event history. This change introduces the IAggregateSnapshot interface and associated integration logic, enabling more efficient loading of aggregate state for long-lived entities.
JKang.EventSourcing.Abstractions · high confidence
Event model now includes aggregate version and timestamp
The event abstraction has been updated to include an AggregateVersion and a Timestamp on every event. This allows users to track the specific version of the aggregate at the time an event occurred and provides a precise timestamp for ordering and auditing, replacing the previous model that lacked these properties.
src/JKang.EventSourcing.Abstractions/Events · high confidence
GiftCard aggregate now supports snapshot reconstruction
The GiftCard testing fixture has been updated to support loading from snapshots. It now includes a constructor that accepts an IAggregateSnapshot alongside saved events, and implements ApplySnapshot and CreateSnapshot methods to restore the balance state from a snapshot before applying subsequent events.
JKang.EventSourcing.TestingFixtures · high confidence
Introduce snapshot-aware aggregate loading and versioned event retrieval
The persistence layer now supports loading aggregates from snapshots to reduce the number of events replayed during initialization. When finding an aggregate, the repository checks for the latest snapshot up to a specified version (or the latest if no version is provided) and only replays events occurring after the snapshot's version. Additionally, the event store interface now exposes methods to retrieve events within a specific version range (minVersion to maxVersion), enabling precise control over which events are loaded for a given aggregate instance.
src/JKang.EventSourcing.Abstractions/Persistence · high confidence
Test coverage
Added tests for DynamoDB event store service configuration; Added tests for aggregate construction and repository loading with version support.
Dependencies
Samples and core libraries migrate to .NET 10 and update dependencies
The sample projects (Samples.Domain, Samples.Events, Samples.Persistence, Samples.WebApp) and the testing web app now target net10.0, while the core JKang.EventSourcing libraries remain on netstandard2.0. This change aligns the samples with the latest .NET runtime and updates underlying dependencies, including Microsoft.EntityFrameworkCore.InMemory to version 10.0.0/10.0.1 and Microsoft.Extensions.\* packages to 10.0.1, ensuring compatibility with the new framework version.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 51 → 49 (-2.3)
- Rubric changed (rubric-2026.08.17 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 53 → 56 (+3.1)
- Architecture 83 → 83 (+0.1)
- Maturity 53 → 55 (+2.8)
- Readiness 45 → 45 (+0.0)
- Security 57 → 45 (-12.0)
- Domain Modelling 87 → 66 (-21.2)
Resolved (30)
- Bounded contexts not declared
- Change coupling: Aggregate.cs ↔ AggregateRepository.cs (src/JKang.EventSourcing.Abstractions/Domain/Aggregate.cs)
- Coverage not measured — analyzer environment
- Duplicated block (23 lines × 2) (src/JKang.EventSourcing.Persistence.CosmosDB/CosmosDBEventStoreInitializer.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 10 more
New (42)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (24 lines × 2) (src/JKang.EventSourcing.Persistence.CosmosDB/CosmosDBEventStoreInitializer.cs)
- Duplicated block (42 lines × 2) (src/JKang.EventSourcing.Persistence.DynamoDB/DynamoDBEventStoreInitializer.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 22 more
Architecture
- Unchanged — 2 containers · 2 contexts · 1 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jacqueskang/EventSourcing was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 3ab1d984558daeedccd49ccf2e89e347c627aad8 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.