Streamstone是一个轻量级的库，它在Windows Azure Table Storage之上实现了事件存储的低级Me chan IC。通过乐观锁定处理并发冲突。支持自定义事件和流元数据。针对批处理进行了优化。
Streamstone is a lightweight library which implements a low-level mechanics of Event Store on top of Windows Azure Table Storage. Handles concurrency conflicts via optimistic locking. Supports custom event and stream metadata. Optimized for batch processing.
event , store , eventstore , eventsourcing , event-sourcing , CQRS , azure , table , storage , stream
Install-Package Streamstone -Version 2.3.0
Streamstone is a small library targeted at building scalable event-sourced applications on top of Azure Table Storage. It has simple, functional style API, heavily inspired by Greg Young's Event Store.
To install Streamstone via NuGet, run this command in NuGet package manager console:
PM> Install-Package Streamstone
To build Streamstone binaries on Windows you will need to have Visual Studio 17 Update 3 or higher and .NET Core SDK 2.0 or higher. To build binaries on Linux use dotnet cli tooling (ie
Unit tests require Azure Storage Emulator 5.2 or higher, which is currently available only on Windows. Alternatively, you could run against real Azure by setting storage account connection string to Streamstone-Test-Storage user-level environment variable.
Streamstone is just a thin layer (library, not a server) on top of Windows Azure Table Storage. It implements low-level mechanics for dealing with event streams, and all heavy-weight lifting is done by underlying provider.
The api is stateless and all exposed objects are immutable, once fully constructed. Streamstone doesn't dictate payload serialization protocol, so you are free to choose any protocol you want.
Optimistic concurrency is implemented by always including stream header entity with every write, making it impossible to append to a stream without first having a latest Etag. Duplicate event detection is done by automatically creating additional entity for every event, with RowKey value set to a unique identifier of a source event (consistent secondary index).
While Streamstone allows you to pass any number of events to
Stream.Write, the max batch size limit imposed by Azure Table Storage is 100 entities, therefore:
InvalidOperationExceptionwhen trying to write an event which together with its includes is over max batch size limit
Other limitations of the underlying Azure Table Storage API: