Fluss 0.0.1-alpha9
dotnet add package Fluss --version 0.0.1-alpha9
NuGet\Install-Package Fluss -Version 0.0.1-alpha9
<PackageReference Include="Fluss" Version="0.0.1-alpha9" />
<PackageVersion Include="Fluss" Version="0.0.1-alpha9" />
<PackageReference Include="Fluss" />
paket add Fluss --version 0.0.1-alpha9
#r "nuget: Fluss, 0.0.1-alpha9"
#:package Fluss@0.0.1-alpha9
#addin nuget:?package=Fluss&version=0.0.1-alpha9&prerelease
#tool nuget:?package=Fluss&version=0.0.1-alpha9&prerelease
Key-Subjects
Event-Sourcing
Instead of a database or other storage mechanism in an event-sourced system the application state is not explicitly recorded, but rather infered from a series of facts from the past. A common example is a banking ledger where we don't want to save the current amount of money in the account, but rather the list of transactions. The money in the account is then simply the sum of all transactions.
This also easily allows a later change of business rules. For example one could define all deposits on a sunday to be worth double and no data would need to be changed, just the business rules.
CQRS / CQS
Command–query separation requires the separation of the read and write parts of an application. This is an added side effect of most event-sourcing implementations and allows one to find a good data representation for read and write which would usually require a tradeoff between them.
Command
Request for a fact to be recorded as an event by a client. This needs to be validated against business rules and if that succeeds can be transformed into one or multiple events.
Event
A timestamped fact of history that is defined as valid. The primary key (version) is an ever-increasing number.
EventRepository
Provides a way of saving and getting a list of events, as well as notifications for new events coming in. There is currently an in-memory implementation as well as a postgres implementation.
WIP: Filtering of the events based on aggregate or readmodel to reduce number of uninteresting events being queried. This idea prevents using a more traditional event database.
ReadModel
For the read part of the application this allows us to get to the state of the application. The state is saved as fields
on the object and the When method is called for every event. In general this implements a fold operation from
functional programming languages. The contract for providing snapshots and change detection with the When method is
that a call to Accepted happens whenever an event changed the state of the ReadModel (This does not have to be 100%
precise, but more precision allows higher accuracy).
Aggregate
For the write part of the application this provides the aforementioned transformation of Commands into Events. Commands
for an Aggregate are encoded as methods on the Aggregate. To record the Event the Apply method has to be called on the
aggregate.
UnitOfWork
This is follows the unit of work pattern and provides values for both read and write parts of the application. For both
of them it holds a ConsistentVersion to not have one part of the read models or aggregates use different facts of
history.
For the read side it allows developers to get a ReadModel at that consistent version.
For the write side it tracks the list of events returned from aggregates and as such provides a model for a transaction in the form of a list of events that can either be published as whole or not.
Cross Aggregate Validation (WIP)
Currently it is not easily possible to validate Commands using state from other aggregates. One example is checking for the uniqueness of a username during registration. We need to find a way to do this.
Snapshots (WIP)
At the start the number of requested events for finding the current state of a read model should be still fine, but at some point we need to introduce the concept of snapshots and a new snapshot repository for that. Then we can get the latest read model from the snapshots and only apply the events after the snapshot.
SideEffect (WIP)
Some of the events require external actions to be taken that are listening to our events i. e. sending an e-mail after registration. A system that tracks and executes these side effects would allow us to decouple the logic for that from the rest of the application.
Upcaster (WIP)
At some point we will need to update our event definitions to included more or different data. When there are two versions of a UserRegistrated event all readmodels interested in users registering need to listen to both of them. Upcasters allow us to centralize that logic.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Collections.Pooled (>= 1.0.82)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.ObjectPool (>= 8.0.8)
- Newtonsoft.Json (>= 13.0.3)
- OpenTelemetry.Api (>= 1.9.0)
- Polly (>= 8.4.1)
- Polly.Contrib.WaitAndRetry (>= 1.1.1)
-
net9.0
- Collections.Pooled (>= 1.0.82)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.ObjectPool (>= 8.0.8)
- Newtonsoft.Json (>= 13.0.3)
- OpenTelemetry.Api (>= 1.9.0)
- Polly (>= 8.4.1)
- Polly.Contrib.WaitAndRetry (>= 1.1.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Fluss:
| Package | Downloads |
|---|---|
|
Fluss.HotChocolate
Adapter between Fluss and HotChocolate to turn one-off queries into live-queries. |
|
|
Fluss.PostgreSQL
Package for Fluss to use a Postgres database as event storage. |
|
|
Fluss.Testing
Package for testing projects using Fluss. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-alpha9 | 121 | 9/30/2024 |
| 0.0.1-alpha8 | 106 | 9/30/2024 |
| 0.0.1-alpha7 | 107 | 9/27/2024 |
| 0.0.1-alpha6 | 106 | 9/27/2024 |
| 0.0.1-alpha5 | 99 | 9/27/2024 |
| 0.0.1-alpha15 | 105 | 10/7/2024 |
| 0.0.1-alpha11 | 103 | 9/30/2024 |
| 0.0.1-alpha10 | 129 | 9/30/2024 |
| 0.0.1-alpha.25 | 200 | 3/19/2025 |
| 0.0.1-alpha.24 | 159 | 3/18/2025 |
| 0.0.1-alpha.23 | 223 | 3/4/2025 |
| 0.0.1-alpha.22 | 198 | 3/4/2025 |
| 0.0.1-alpha.21 | 217 | 3/4/2025 |
| 0.0.1-alpha.20 | 153 | 12/9/2024 |
| 0.0.1-alpha.19 | 177 | 11/6/2024 |
| 0.0.1-alpha.18 | 115 | 10/22/2024 |
| 0.0.1-alpha.17 | 117 | 10/10/2024 |
| 0.0.1-alpha.16 | 115 | 10/7/2024 |
| 0.0.1-alpha.14 | 106 | 10/2/2024 |
| 0.0.1-alpha.12 | 99 | 10/2/2024 |