Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nstoredev/NStore
Opinionated eventsourcing library
https://github.com/nstoredev/NStore
ddd dotnetcore eventsourcing
Last synced: 3 months ago
JSON representation
Opinionated eventsourcing library
- Host: GitHub
- URL: https://github.com/nstoredev/NStore
- Owner: nstoredev
- License: mit
- Created: 2017-04-16T17:03:36.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-04T16:35:17.000Z (10 months ago)
- Last Synced: 2024-04-14T09:24:57.615Z (7 months ago)
- Topics: ddd, dotnetcore, eventsourcing
- Language: C#
- Homepage:
- Size: 1.24 MB
- Stars: 87
- Watchers: 21
- Forks: 15
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome_dotnet_cloud_ecosystem - Opinionated eventsourcing library
README
# NStore
## (Yet Another) Opinionated Event Sourcing Library
NStore started as a playground for experimenting with .net Standard, async and a simple API for a Sql/NoSql backed EventStore.
After years of experience running NEventStore in production we wrote NStore from scratch with a simpler and extensible API.
## CI Status
| Build server | Platform | Build Status |
| ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AppVeyor | Windows | [](https://ci.appveyor.com/project/andreabalducci/nstore) | |
| GH Actions | Linux | [](https://github.com/ProximoSrl/NStore/blob/develop/.github/workflows/ci.yml) |
| Azdo | Windows | [](https://dev.azure.com/gianmariaricci/Public/_build/latest?definitionId=130) |## Quickstart
Setup the streams factory
```csharp
var streams = new StreamsFactory(new InMemoryPersistence());
```
open the stream
```csharp
var post = streams.Open("post/123");
```
append new data
```csharp
await post.AppendAsync(new Favorited("users/200", DateTime.UtcNow));
```
read the stream
```csharp
await post.ReadAsync(chunk =>
{
Console.WriteLine($"{chunk.PartitionId} #{chunk.Index} => {chunk.Payload}");
return Subscription.Continue;
});
```Process the stream
```csharp
var favs = await post.AggregateAsync();Console.WriteLine($"{favs.Count} users added '{post.Id}' as favorite");
```
Full source at [src/NStore.Quickstart/Program.cs](src/NStore.Quickstart/Program.cs)
---
## Learn
The source comes with a [Sample App](https://github.com/ProximoSrl/NStore/tree/develop/src/NStore.Sample) to illustrate some basic stuff you can do.