Dzoukr/CosmoStore
46.1
Weak · 9 November 2026
1.6k
lines of production code
F#
with JavaScript
9
measurements over time
What this system is
CosmoStore is a modular event sourcing library for .NET that provides a unified API for appending and retrieving events across multiple storage backends. It supports pluggable persistence providers including Azure Cosmos DB, Azure Table Storage, Marten, ServiceStack, LiteDB, and an in-memory implementation. The system allows users to define custom versioning strategies and manage streams with features like correlation ID lookups and optimistic concurrency checks.
How it got here
2018 — Modularization and API refactoring
4 changes.
The project underwent a significant structural overhaul, splitting the monolithic library into separate NuGet packages for each storage provider to enable modular usage. Concurrently, the core API was refactored to support generic payloads and versioning, replacing legacy code with a more flexible design. This period also involved migrating the build system to FAKE and updating the test suite to the Expecto framework.
2019–2020 — storage provider expansion and testing
10 changes.
This period focused on expanding the CosmoStore ecosystem by introducing new storage backends, including Marten, ServiceStack, and an in-memory implementation, alongside significant updates to existing Azure Cosmos DB and Table Storage providers. The work also involved modernizing the testing infrastructure by migrating to the Expecto framework and adding comprehensive integration tests for all supported storage strategies.
Features
Initial release of Marten-backed event store provider
This change introduces the \CosmoStore.Marten\ provider, enabling event sourcing with PostgreSQL via the Marten library. It implements the core event store operations (appending events, retrieving events by stream or correlation ID, and managing streams) using Marten's document store and lightweight sessions. The provider includes configuration for database connection details and a custom JSON serializer setup to handle F\# types like enums and options.
src/CosmoStore.Marten · high confidence
Initial release of ServiceStack-backed Event Store
This change introduces the first version of the ServiceStack integration for CosmoStore, adding a new persistence layer that stores events and streams using ServiceStack OrmLite. The implementation includes database mapping for \StreamDB\ and \EventReadDB\ tables, logic to handle event appending with optimistic concurrency checks, and methods for retrieving events by stream, version range, or correlation ID. It relies on ServiceStack's \IDbConnectionFactory\ and \IStringSerializer\ to manage database connections and serialize event data.
src/CosmoStore.LiteDb, src/CosmoStore.ServiceStack · high confidence
Initial release of in-memory event store implementation
This change introduces the \CosmoStore.InMemory\ package, providing an in-memory implementation of the CosmoStore event store interface. It allows users to utilize the library without an external database by storing events and streams in concurrent dictionaries, supporting features such as appending single or multiple events, retrieving events by stream or correlation ID, and filtering streams by name patterns.
src/CosmoStore.InMemory · high confidence
Behavioural changes
Build system migrated to FAKE with modularized store packages
The build process has been replaced with a FAKE-based script (Build.fs) that defines distinct pack, test, and publish targets for each storage provider (Cosmos DB, Table Storage, Marten, InMemory, LiteDB, and ServiceStack). This change accompanies the solution structure where the library is split into separate packages (e.g., CosmoStore.CosmosDb, CosmoStore.Marten), allowing users to reference only the specific storage backend they require rather than a monolithic library.
(repo-wide) · high confidence
CosmoStore API refactored to support generic payloads and versions
The CosmoStore library has been refactored to use generic types for both event payloads and version numbers, allowing users to define their own versioning strategy (e.g., int64, uint64) rather than being locked into a specific type. This change introduces new core types in \CosmoStore.fs\, including \EventRead\<'payload,'version\>\ and \EventWrite\<'payload\>\, and updates the \EventStore\ interface to operate on these generic parameters. Additionally, validation logic for version checks has been split into \Validation.fs\ to handle both signed and unsigned integer versions, and a conversion helper in \Conversion.fs\ facilitates mapping between write and read models. The legacy \Library.fs\ containing a simple 'Hello' function has been removed.
src/CosmoStore · high confidence
Cosmos DB storage backend introduces Version 3 with configurable container settings
The Cosmos DB storage implementation now supports a new storage strategy (Version 3) that uses a 'version' field instead of the previous 'position' field for event ordering, alongside the existing Version 2. This change is accompanied by a Configuration record that allows users to specify a custom DatabaseName, ContainerName, and Throughput, and to control whether the container is automatically initialized. The backend also includes stored procedures for both versions to handle event appending and metadata updates within Azure Cosmos DB.
src/CosmoStore.CosmosDb · high confidence
Migrate to Azure.Data.Tables SDK with SAS and Sovereign Cloud support
The TableStorage provider now uses the modern Azure.Data.Tables SDK instead of the legacy WindowsAzure.Storage package, enabling authentication via SAS tokens and configuration for sovereign cloud endpoints. The storage schema remains backward compatible with version 2.x data by handling both 'Position' and 'Version' fields, ensuring existing streams continue to function correctly without data migration.
src/CosmoStore.TableStorage · high confidence
Test coverage
Added Expecto-based test suite for CosmoStore; Added InMemory event store test suite; Added LiteDB integration tests for CosmoStore; Added V2 integration tests for Cosmos DB and Table Storage event stores; Added test runner for Table Storage tests; Migrated Cosmos DB tests to Expecto.
Dependencies
CosmoStore library split into separate NuGet packages
The CosmoStore library has been split into distinct packages for each storage provider, allowing users to reference only the specific backend they need. New packages include CosmoStore.CosmosDb, CosmoStore.InMemory, CosmoStore.LiteDb, CosmoStore.Marten, CosmoStore.ServiceStack, and CosmoStore.TableStorage, all depending on the core CosmoStore API package. The core package now includes additional files (CosmoStore.fs, Conversion.fs, Validation.fs) and generates documentation. Test projects have also been split to match the new structure, with separate test projects for each provider (e.g., CosmoStore.CosmosDb.Tests, CosmoStore.TableStorage.Tests) and a shared test project (CosmoStore.Tests).
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 46 → 46 (+0.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 98 → 98 (+0.0)
- Architecture 96 → 96 (+0.0)
- Maturity 47 → 47 (+0.0)
- Readiness 17 → 17 (+0.0)
- Security 87 → 87 (+0.0)
- Performance 100 → 100 (+0.0)
Resolved (5)
- Coverage not measured — no coverage collector is wired up
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- End-of-life runtime: .NET net6.0 (Build.fsproj)
- Off-boarding risk: anonymized user #1
New (11)
- End-of-life runtime: .NET net6.0 (Build.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.CosmosDb.Tests.V2/CosmoStore.CosmosDb.Tests.V2.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.CosmosDb.Tests/CosmoStore.CosmosDb.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.InMemory.Tests/CosmoStore.InMemory.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.LiteDB.Tests/CosmoStore.LiteDb.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.Marten.Tests/CosmoStore.Marten.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.ServiceStack.Tests/CosmoStore.ServiceStack.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.TableStorage.Tests.V2/CosmoStore.TableStorage.Tests.V2.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.TableStorage.Tests/CosmoStore.TableStorage.Tests.fsproj)
- End-of-life runtime: .NET net6.0 (tests/CosmoStore.Tests/CosmoStore.Tests.fsproj)
- Off-boarding risk: anonymized user #1
Architecture
- Unchanged — 0 containers · 9 contexts · 10 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Dzoukr/CosmoStore 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 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 58d541edfefdd289ba09b9e03b71ec00eacebc78 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.