Orleans.EventSourcing.EventStorage 8.0.0

dotnet add package Orleans.EventSourcing.EventStorage --version 8.0.0
                    
NuGet\Install-Package Orleans.EventSourcing.EventStorage -Version 8.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Orleans.EventSourcing.EventStorage" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Orleans.EventSourcing.EventStorage" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Orleans.EventSourcing.EventStorage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Orleans.EventSourcing.EventStorage --version 8.0.0
                    
#r "nuget: Orleans.EventSourcing.EventStorage, 8.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Orleans.EventSourcing.EventStorage@8.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Orleans.EventSourcing.EventStorage&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Orleans.EventSourcing.EventStorage&version=8.0.0
                    
Install as a Cake Tool

Orleans.EventSourcing.EventStorage

Getting Started

Install from NuGet:

Install-Package Orleans.EventSourcing.EventStorage

or

dotnet add package Orleans.EventSourcing.EventStorage

Configure your silo:

builder.Host.UseOrleans(siloBuilder =>
{
    siloBuilder.UseLocalhostClustering();
    siloBuilder.AddEventStorageBasedLogConsistencyProviderAsDefault();
    siloBuilder.AddMemoryEventStorageAsDefault();
});

FAQ

What is Orleans?

Orleans is a cross-platform framework for building robust, scalable distributed applications.

Documentation

What is Event Sourcing?

Event sourcing is approach to handling operations on data that's driven by a sequence of events, each of which is recorded in an append-only store.

Read more:

Why use Event Sourcing with Orleans?

Not only does the Orleans framework make it extremely easy to implement the event sourcing pattern, but they also compliment each other really well. Orleans can solve many of the issues that come along with using event sourcing, and vice versa.

Orleans is not great at doing queries over grain data. Event sourcing can help resolve this shortcoming by using it alongside CQRS. The combination of event sourcing and CQRS means that you can implement a write side (commands) using orleans grains, while also having a read side (queries) that are simply a projection of the events in the event store.

Orleans also struggles with certain aspects of event driven architectures, such as reliably publishing events if and only if a write is successful. In many traditional architectures this is achieved using a transactional outbox, which is unfortunately quite complex to implement in Orleans due to the way grain data is persisted by default. Using event sourcing with your Orleans grains resolves this issue since the state being stored and the event to be published are one and the same.

Orleans can also help with some of the shortcomings of traditional event sourcing. One of the common struggles with event sourcing is the need to rehydrate the current state of an entity from the events stored in the event store. If the stream of events is long, this can become a costly operation. Orleans helps in this regard because it can keep grains alive and incrementally apply updates to the activated grains, reducing the number of times that the entire event stream needs to be read and applied.

Why not use the built-in log-consistency providers?

Orleans currently ships with 3 built-in log-consistency providers.

State storage

Stores grain snapshots, which is to say that it stores only the most recent version of the grain state in storage. In many ways this is not true event sourcing because it does not actually persist the log of events.

Log storage

Stores the complete event sequence as a single object. While this does store all the events in the log, it is not recommended for production use because it stores the entire sequence in a single entry that must be read/written every time the entry is accessed.

Custom storage

Custom storage is flexible provider that allows the developer to plug-in their own storage mechanism while assuming very little about how the events will be stored. While this can be an effective option, it has its downsides:

  • It requires implementing the ICustomStorageInterface<TState,TDelta> interface in your grains. This means your grains become responsible for managing their own storage, which is a violation of the single-responsibility principle and separation of concerns.
  • A different implementation of ICustomStorageInterface<TState,TDelta> is required for every grain type that needs to be stored.
  • It's a heavy-handed approach that isn't necessary for most people for whom a more pre-configured solution would suffice.
  • The custom storage provider doesn't support RetrieveConfirmedEvents.
Product 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Orleans.EventSourcing.EventStorage:

Package Downloads
Orleans.EventSourcing.EventStorage.EventStore

Package Description

Orleans.EventSourcing.EventStorage.Marten

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 2,339 1/14/2024
0.7.1 366 12/3/2023
0.7.0 205 12/1/2023