Giter Site home page Giter Site logo

streamstone's Introduction

Streamstone's logo

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.

Features

  • Fully ACID compliant
  • Optimistic concurrency support
  • Duplicate event detection (based on identity)
  • Automatic continuation for both writes and reads (over WATS limits)
  • Custom stream and event properties you can query on
  • Synchronous (inline) projections and snapshots
  • Change tracking support for inline projections
  • Friendly for multi-tenant designs

Installing from NuGet NuGet

To install Streamstone via NuGet, run this command in NuGet package manager console:

PM> Install-Package Streamstone

Building from source Build status

To build Streamstone's binaries, just clone the repository and build solution from Visual Studio, Alternatively, run the following command from solution's root directory:

> Nake.bat

For a list of available commands run Nake.bat -T.

Design

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 making version part of RowKey identifier. 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).

Schema

Schema


Schema for virtual partitions

Usage

Essentials
  • Provisioning stream [see]
  • Opening stream [see]
  • Writing to stream [see]
  • Reading from stream [see]
  • Additional entity includes [see]
  • Optimistic concurrency [see]
  • Handling duplicate events [see]
  • Custom stream metadata [see]
  • Virtual partitions [see]
Application
  • Implementing stream directory [see]
  • Using snapshots [see]
  • Creating projections [see]
  • Querying events [see]
Demo
  • Classic Greg Young's CQRS demo using Streamstone [repo]
  • Using Streamstone in stateful applications. Event-sourced actors for Project Orleans [see]

Limitations

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:

  • The batch will be automatically flushed for every 99 events (100 - 1 header entity)
  • The batch will be automatically flushed for every 49 events with id being set (100/2 - 1 header entity)
  • You will get back InvalidOperationException when trying to write an event which together with its includes is over max batch size limit
  • The actual size in bytes of event payload is not taken into account, so all limitations outlined below still apply

Other limitations of the underlying Azure Table Storage API:

  • Maximum size of batch is 4MB
  • Maximum size of entity is 1 MB
  • Maximum size of property is 64Kb
  • Maximum length of property name is 255 chars
  • An entity can have up to 255 custom properties

WATS limitations on MSDN

Community

Gitter

License

Apache 2 License

streamstone's People

Contributors

gitter-badger avatar jkonecki avatar yevhen avatar

Watchers

 avatar  avatar

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.