Skip to content

A server-less .NET Event Store based on the Atom syndication format

License

Notifications You must be signed in to change notification settings

iQmetrix/AtomEventStore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AtomEventStore

A server-less .NET Event Store based on the Atom syndication format.

Highlights:

AtomEventStore is designed to be a lightweight Event Store implementation. It offers the following benefits:

  • No server required; only storage
  • Human-readable storage format
  • Supports file storage
  • Supports in-memory storage
  • Supports Azure Blob storage
  • Designed to be scalable
  • Extensible

Due to its flexible design and simple storage requirements, you can easily implement a storage implementation on top of your favourite storage mechanism: document databases, relational database, and so on. All you have to do is to implement a single interface with two methods! If you are interested in contributing a storage implementation, please first submit an issue to start the discussion.

At a glance

AtomEventStore is easy to use, and is built on well-known abstractions already present in .NET.

Writing events

You write events one at a time using the AtomEventObserver<T> class.

Synchronous writes

In this example, obs is an instance of AtomEventObserver<object>, and userCreated is represent an event:

obs.OnNext(userCreated);

When the call to obs.OnNext returns, the userCreated event has been written to storage.

Asynchronous writes

Asynchronous writes can be done using the standard Task Parallel Library (TPL) model for asynchrony:

await obs.AppendAsync(userCreated);

Notice that since AtomEventObserver<T> uses the standard TPL model, you can use it with async and await.

When the task returned by obs.AppendAsync completes, the userCreated event has been written to storage.

Reading events

You can read events either forwards or backwards. In both cases, reading events is based on the standard IEnumerable<T> interface.

var firstEvent = events.First();

The above example simply reads the first event in the event stream.

NuGet

AtomEventStore is available via NuGet:

Versioning

AtomEventStore follows Semantic Versioning 2.0.0.

Credits

The idea that an Event Store can be modelled as a Linked List was originally put to my attention by Yves Reynhout in his article Your EventStream is a linked list.

About

A server-less .NET Event Store based on the Atom syndication format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 95.3%
  • F# 4.4%
  • Other 0.3%