GithubHelp home page GithubHelp logo

jangocheng / manta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justinhachemeister/manta

0.0 1.0 0.0 247 KB

Event store library for .NET Core based on rdbms persistance.

License: Apache License 2.0

C# 94.89% TSQL 5.11%

manta's Introduction

logo

Manta

Event store library for .NET Core based on rdbms persistance.

A thin (but powerful) slice of library between your code and rdbms.

Status

ALMOST READY FOR PRODUCTION USAGE

Build status

Installation

Manta is not available on NuGet, yet.

You can download source code from this repository and compile under Visual Studio 2017.

Main goals

Done

  • Async all the way down
  • No external dependencies
  • Pluggable persistance storage
  • Idempotent writes
  • Support optimistic concurrency
  • Support any kind of message serialization
  • Support any kind of loggers through ILogger interface for Manta internal logging
  • Support up-conversion of events to the newest version
  • Subscriptions to one or many event stream sources for processmanagers/projections/others
  • MS SQL Server - Manta implementation (with single-writer pattern)
  • MS SQL Server - Manta.Projections implementation

last but not least, performance

  • on i5 2500k with SSD benchmarked ~15,000 writes per second
  • on i7 8700k with SSD benchmarked ~25,000 writes per second (reading streams are really fast)

SSD disk speed is an important factor

To be done

  • Manta - InMemory implementation
  • Manta.Projections - InMemory implementation
  • Manta.PostgreSql - PostgreSql implementation
  • Manta.MySql - MySql implementation
  • Manta.SqLite - SqLite implementation

Others

  • Manta.Domain (as different repository)
    • Manta.Domain - Conflict resolver, repository pattern, unit of work, e.t.c.

Getting started

// Simple class representing event/message which will be stored

[DataContract]
public class SomeEvent
{
    [DataMember(Order = 1)]
    public string Name { get; private set; }

    public SomeEvent(string name)
    {
        Name = name;
    }
}

// Basic example of usage

ISerializer serializer = new JilSerializer(); // You can use any type of serialization method
ArraySegment<byte> payload = serializer.Serialize(ev);
string contractName = GetContractNameBasedOnEventType(ev.GetType());

var data = new UncommittedMessages(
    SequentialGuid.NewGuid(), // correlationId
    new []
    {
        new MessageRecord(
            SequentialGuid.NewGuid(), // messageId
            contractName,
            payload)
    });

await store.AppendToStream(
    "stream-1",
    ExpectedVersion.NoStream,
    data);

More examples you can find on wiki.

Documentation

If you're looking for documentation, you can find it here.

Contributing

A contribution is welcome. Checkout contributing rules.

manta's People

Watchers

 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.