Giter Club home page Giter Club logo

dcb-eventstore's Introduction

I am human ๐Ÿค–

More specifically a man ๐Ÿ‘ฑ๐Ÿผโ€โ™‚๏ธ

More specifically a German programmer trying to teach machines something about our life while learning more about theirs ๐Ÿง‘๐Ÿฝโ€๐Ÿ’ป

dcb-eventstore's People

Contributors

bwaidelich avatar

Watchers

 avatar  avatar

dcb-eventstore's Issues

Proper consistency and performance tests

This package provides tools to easily test the performance and consistency of event store implementations for distributed systems.

Maybe something along jepsen Tests or just a way to spawn multiple processes in parallel that interact with the same event store and test for consistency violations

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$ref": "#/$defs/AppendCondition",
  "$defs": {
    "AppendCondition": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "query": {
          "$ref": "#/$defs/StreamQuery"
        },
        "expected_highest_sequence_number": {
          "oneOf": [
            {
              "const": "NONE"
            },
            {
              "const": "ANY"
            },
            {
              "$ref": "#/$defs/SequenceNumber"
            }
          ]
        }
      },
      "required": [
        "query",
        "expected_highest_sequence_number"
      ]
    },
    "StreamQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+$"
        },
        "criterias": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StreamQueryCriteria"
          }
        }
      },
      "required": [
        "version",
        "criterias"
      ]
    },
    "StreamQueryCriteria": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "EventTypesAndTags",
            "EventTypes",
            "Tags"
          ]
        },
        "properties": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "tags": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Tag"
              }
            },
            "event_types": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/EventType"
              }
            }
          },
          "required": [
            "tags",
            "event_types"
          ]
        }
      },
      "required": [
        "type",
        "criteria"
      ]
    },
    "EventEnvelope": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "event": {
          "$ref": "#/$defs/Event"
        },
        "sequence_number": {
          "$ref": "#/$defs/SequenceNumber"
        }
      },
      "required": [
        "event",
        "sequence_number"
      ]
    },
    "Event": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/EventId"
        },
        "type": {
          "$ref": "#/$defs/EventType"
        },
        "data": {
          "$ref": "#/$defs/EventData"
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tag"
          }
        }
      },
      "required": [
        "id",
        "type",
        "data",
        "tags"
      ]
    },
    "EventId": {
      "type": "string",
      "pattern": "^[\\w\\-]+$",
      "minLength": 1,
      "maxLength": 100
    },
    "EventType": {
      "type": "string",
      "pattern": "^[\\w\\.\\:\\-]+$",
      "minLength": 1,
      "maxLength": 200
    },
    "EventData": {
      "type": "string"
    },
    "Tag": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[A-Za-z0-9\\-\\_]+$"
        },
        "value": {
          "minLength": 1,
          "maxLength": 50,
          "type": "string",
          "pattern": "^[A-Za-z0-9\\-\\_]+$"
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "SequenceNumber": {
      "type": "integer",
      "minimum": 1
    }
  }
}

DomainIds should be able to contain multiple (different) values for the same key

DomainIds are currently serialized as JSON object in the form:

{"key1": "some-value", "key": "some-value"}

Instead it should be stored as an array like:

[{"key1": "some-value"}, {...}]

Validation has to be adjusted accordingly.

use case

To ensure usernames are unique, events could look like:

[{
  "type": "UsernameClaimed",
  "data": {"username": "some-username"}
  "domainIds": [{"username": "some-username"}]
}, {
  "type": "UsernameChanged",
  "data": {"newUsername": "some-new-username"}
  "domainIds": [{"username": "some-username"}, {"username": "some-new-username"}]
},

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.