Coder Social home page Coder Social logo

alexsugak / atomeventstore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from greantech/atomeventstore

0.0 2.0 0.0 25.57 MB

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

License: MIT License

C# 95.45% F# 4.29% PowerShell 0.07% Shell 0.18%

atomeventstore's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.