Compze.Teventive.MemoryImageStateStore
0.4.4-alpha
Prefix Reserved
See the version list below for details.
dotnet add package Compze.Teventive.MemoryImageStateStore --version 0.4.4-alpha
NuGet\Install-Package Compze.Teventive.MemoryImageStateStore -Version 0.4.4-alpha
<PackageReference Include="Compze.Teventive.MemoryImageStateStore" Version="0.4.4-alpha" />
<PackageVersion Include="Compze.Teventive.MemoryImageStateStore" Version="0.4.4-alpha" />
<PackageReference Include="Compze.Teventive.MemoryImageStateStore" />
paket add Compze.Teventive.MemoryImageStateStore --version 0.4.4-alpha
#r "nuget: Compze.Teventive.MemoryImageStateStore, 0.4.4-alpha"
#:package Compze.Teventive.MemoryImageStateStore@0.4.4-alpha
#addin nuget:?package=Compze.Teventive.MemoryImageStateStore&version=0.4.4-alpha&prerelease
#tool nuget:?package=Compze.Teventive.MemoryImageStateStore&version=0.4.4-alpha&prerelease
Compze.Teventive.MemoryImageStateStore
The memory image state store: a memory image of Compze taggregates. Every taggregate is held in memory for the container's life, and rebuilt at the store's start from a snapshot of each, which its storage keeps: it keeps taggregates as their state, not their history.
What is Compze?
Compze is a .NET framework for building expressive domains through Teventive programming and Typermedia APIs. Learn more
What's in this package?
- The memory image state store — composed with
MemoryImageStateStore(...), it keeps the taggregate classes declared for it in memory, and in JSON files, or in a database's tables, if they are declared. - JSON files —
StoredInJsonFiles(...): a file for each taggregate, in a folder for each class, written with the consumer'sJsonSerializerOptions, and a unit of work's files written all or none. Compze.Teventive.MemoryImageStateStore.MemoryPack adds a cache to start from, so a start reads only the files changed since.ITaggregateJsonFilesgives the path of each taggregate's file, and the taggregate each file is the file of. For specifications,OnAFileSystemInMemory(), in theTestingnamespace, puts the files on a file system in memory, read and changed throughIFileSystemInMemory, with no disk I/O. - A database's tables —
StoredInTheDomainDatabase(...): a row for each taggregate in the domain database, holding its class by a name declared for it and its snapshot as the consumer'sJsonSerializerOptionswrite it, beside the store's SQL layer from Compze.Teventive.MemoryImageStateStore.Sqlite, .MicrosoftSql, .PostgreSql or .MySql. A unit of work commits as one database transaction, with whatever else it writes to the database, such as an exactly-once endpoint's inbox and outbox. - One memory image at a time — the store is built to be fast for one process: what it holds in memory is what its storage holds, so every read reads memory. Its first load takes its storage's lock, and holds it until the container is disposed: for files, a file in the store's own folder, released by the operating system when the process dies; for tables, a process lock of the domain database, the kind an exactly-once endpoint holds, released by the database when the holder's process dies. A second memory image, in another process, on another machine, or in another container of the same process, is refused at its first load with a
TimeoutExceptionnaming the holder: what for, which process, on which machine, and since when.WaitingForAnotherMemoryImageToReleaseTheStorage(atMost)has it wait for the holder instead, for a hand-over between processes; Compze doesn't tell the holder that another waits. Disposing the container refuses every use of the store from then on, and releases the lock only once no write of the store can still land: a unit of work that is committing as disposing begins commits first, and one that isn't yet rolls back. - Reloads and rewrites —
IMemoryImageStateStore.LoadFromStorage()loads the files or rows again and reports which taggregates another program added, changed or removed, comparing state as the store writes it, so snapshot types need no equality, and for files only the files changed since the store last read or wrote them.IMemoryImageStateStore.WriteAllToStorage()writes every file or row anew, as one commit, after a change to the snapshot types or to the serializer's options. - Units of work with private copies — each unit of work changes its own copy of a taggregate, holding its lock until it completes, and the copy becomes the committed instance when it commits.
- Synchronous dispatch — the tevents a unit of work's taggregates publish are dispatched as each publish cascade ends, once the taggregate's invariants hold, so participation handlers run inside the domain call and the unit of work's transaction.
- Indexes defined by state —
ITaggregateIndex<TTaggregate, TKey>files taggregates under keys their state gives, in no particular order, and reads its own unit of work's changes. A store has one index for each pair of taggregate class and key type, and a key function reads only the taggregate's own state. - Every taggregate of a class —
ITaggregateStoreBulkReader.ReferencesToAll<TTaggregate>(), in no particular order. - What holding everything costs — its memory is the whole data set, and it loads every taggregate at its first use, on that use's thread: call
LoadFromStorage()at the application's start to choose when. A failure after a commit's journal is written stops the process (Environment.FailFast), and the next start finishes the commit. The files are written, not flushed to the disk. Its waits, for a taggregate's lock and between a load and the units of work, give up after 30 seconds.
The interfaces it implements, ITaggregateStoreReader, ITaggregateStoreBulkReader and ITaggregateStoreUpdater, are in Compze.Teventive.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Compze.Abstractions (>= 0.5.1-alpha)
- Compze.Contracts (>= 0.7.2)
- Compze.DependencyInjection (= 0.11.1-alpha)
- Compze.Internals.SystemCE (= 0.16.0-internal)
- Compze.Tessaging.Abstractions (>= 0.9.0-alpha)
- Compze.Teventive (= 0.9.2-alpha)
- Compze.Threading (>= 0.14.1-alpha)
- Compze.Threading.Interprocess (>= 0.11.3-alpha)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Compze.Teventive.MemoryImageStateStore:
| Package | Downloads |
|---|---|
|
Compze.Teventive.MemoryImageStateStore.PostgreSql
The PostgreSQL tables of Compze's memory image state store: PgSqlMemoryImageStateStoreSqlLayer(), for a memory image state store kept in the tables of a PostgreSQL domain database, which one memory image at a time uses. |
|
|
Compze.Teventive.MemoryImageStateStore.MySql
The MySQL tables of Compze's memory image state store: MySqlMemoryImageStateStoreSqlLayer(), for a memory image state store kept in the tables of a MySQL domain database, which one memory image at a time uses. |
|
|
Compze.Teventive.MemoryImageStateStore.MicrosoftSql
The SQL Server tables of Compze's memory image state store: MsSqlMemoryImageStateStoreSqlLayer(), for a memory image state store kept in the tables of a SQL Server domain database, which one memory image at a time uses. |
|
|
Compze.Teventive.MemoryImageStateStore.Sqlite
The SQLite tables of Compze's memory image state store: SqliteMemoryImageStateStoreSqlLayer(), for a memory image state store kept in the tables of a SQLite domain database, which one memory image at a time uses. |
|
|
Compze.Teventive.MemoryImageStateStore.MemoryPack
A MemoryPack cache for Compze.Teventive.MemoryImageStateStore's JSON files, so a memory image state store kept in files starts from the cache and reads only the files changed since. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.9-alpha | 0 | 12/5/2026 |
| 0.9.8-alpha | 0 | 12/5/2026 |
| 0.9.7-alpha | 0 | 12/5/2026 |
| 0.9.6-alpha | 8 | 12/5/2026 |
| 0.9.5-alpha | 22 | 12/5/2026 |
| 0.9.4-alpha | 51 | 12/5/2026 |
| 0.9.3-alpha | 80 | 12/5/2026 |
| 0.9.2-alpha | 75 | 12/4/2026 |
| 0.9.1-alpha | 53 | 12/4/2026 |
| 0.9.0-alpha | 66 | 12/4/2026 |
| 0.8.0-alpha | 69 | 12/4/2026 |
| 0.7.1-alpha | 74 | 12/3/2026 |
| 0.7.0-alpha | 166 | 12/2/2026 |
| 0.6.0-alpha | 119 | 12/1/2026 |
| 0.5.0-alpha | 85 | 12/1/2026 |
| 0.4.5-alpha | 97 | 11/29/2026 |
| 0.4.4-alpha | 96 | 11/28/2026 |
| 0.4.3-alpha | 94 | 11/28/2026 |
| 0.4.2-alpha | 97 | 11/28/2026 |
| 0.4.1-alpha | 61 | 11/27/2026 |
- **Requires exact versions of the Compze packages whose internals it uses:** Compze.DependencyInjection 0.11.1-alpha (was 0.11.0-alpha), Compze.Internals.SystemCE 0.16.0-internal (was 0.15.0-internal), Compze.Teventive 0.9.2-alpha (was 0.9.1-alpha). Upgrading to this version upgrades each package listed here to exactly that version, so their changelogs apply to this upgrade as well.