Compze.Teventive.MemoryImageStateStore
0.9.3-alpha
Prefix Reserved
See the version list below for details.
dotnet add package Compze.Teventive.MemoryImageStateStore --version 0.9.3-alpha
NuGet\Install-Package Compze.Teventive.MemoryImageStateStore -Version 0.9.3-alpha
<PackageReference Include="Compze.Teventive.MemoryImageStateStore" Version="0.9.3-alpha" />
<PackageVersion Include="Compze.Teventive.MemoryImageStateStore" Version="0.9.3-alpha" />
<PackageReference Include="Compze.Teventive.MemoryImageStateStore" />
paket add Compze.Teventive.MemoryImageStateStore --version 0.9.3-alpha
#r "nuget: Compze.Teventive.MemoryImageStateStore, 0.9.3-alpha"
#:package Compze.Teventive.MemoryImageStateStore@0.9.3-alpha
#addin nuget:?package=Compze.Teventive.MemoryImageStateStore&version=0.9.3-alpha&prerelease
#tool nuget:?package=Compze.Teventive.MemoryImageStateStore&version=0.9.3-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 Compze's serializer of snapshots, 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 and text of each taggregate's file, identifies a taggregate by its file path, and restores a taggregate from file text such as an earlier version from source control. 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 Compze's serializer of snapshots writes 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. - Compze's serializer — the files and rows hold what Compze's serializer of snapshots writes, which the container registers, such as with
NewtonsoftTaggregateSnapshotSerializer()of Compze.Serialization.Newtonsoft: a snapshot is a consumer's type, serialized as Compze serializes every consumer's type it keeps. A polymorphic value in a snapshot is written with the type map'sTypeIdfor its type, so its type needs a mapping and can be renamed freely; the snapshot type itself needs none. - 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. - 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. A unit of work waiting for a taggregate's lock, or for a reload or rewrite to finish, gives up if its transaction ends first. A reload or rewrite waits up to 30 seconds to start because it has no transaction of its own.
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.8.1-alpha)
- Compze.Contracts (>= 0.7.2)
- Compze.DependencyInjection (= 0.13.0-alpha)
- Compze.Internals.SystemCE (= 0.18.2-internal)
- Compze.Tessaging.Abstractions (>= 0.14.0-alpha)
- Compze.Teventive (= 0.14.1-alpha)
- Compze.Threading (>= 0.16.2-alpha)
- Compze.Threading.Interprocess (>= 0.16.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
Discontinued: this is its last version. Compze no longer supports SQLite: it runs one writer at a time, so it could never be a fully supported persistence layer. Use Compze.Teventive.MemoryImageStateStore.MicrosoftSql for SQL Server, Compze.Teventive.MemoryImageStateStore.PostgreSql for PostgreSQL or Compze.Teventive.MemoryImageStateStore.MySql for MySQL. 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.Internals.SystemCE 0.18.2-internal (was 0.18.1-internal). Upgrading to this version upgrades each package listed here to exactly that version, so their changelogs apply to this upgrade as well.