Skip to content
/ equinox Public

.NET event sourcing library with CosmosDB, DynamoDB, EventStoreDB, message-db, SqlStreamStore and integration test backends. Focused at stream level; see https://github.com/jet/propulsion for cross-stream projections/subscriptions/reactions

License

Notifications You must be signed in to change notification settings

jet/equinox

Repository files navigation

Foldunk

Foldunk is a low-dependency set of infrastructure, examples and tests illustrating a consistent approach to Event-sourced Decision processing against ordered stream stores in F#.

Intended audience

The key consumer of this codebase is the Jet.com production site.

However,the codebase as a whole; particularly the, Samples are intended to achieve a critical secondary goal of sharing/discussing/prototyping usage patterns. As such, it's intended to be feasible to use it in the following contexts:

  • a testbed for illustrating and prototyping decision/state processing mechanisms
  • sample codebase for both internal and external facing Jet.com training events and talks
  • base infrastructure for third party talks / tutorials

Please raise GitHub issues for any questions so others can benefit from the discussion.

Elements

  • Foldunk.Handler: a store agnostic Decision flow runner that fulfills key request processing objectives as dictated by the requirements of Jet.com's front-end API layer
  • Foldunk.Serialization:
    • helpers for simplifying the writing of json.net JsonConverters
    • a set of json.net Converters, mainly specific to F# types
  • Foldunk.EventStore: Production-strength EventStore Adapter instrumented to the degree necessitated by Jet's production monitoring requirements
  • sufficient logging and metrics instrumentation capabilties to be used in a Production context

Features

  • Does not emit any specific logs, but is sufficiently instrumented (using Serilog to allow one to adapt it to ones application (we feed log info to NLog and onwards to Splunk atm and feed the metrics embedded therein to prometheus; see relevant tests for examples)
  • EventSum encoding: a scheme for the serializing Events modelled as an F# Discriminated Union with the following capabilities:
    • independent of any specific serializer
    • allows tagging of Discriminated Union cases with eventType tags in a versionable manner using TypeShape's EventSum
  • Compaction: A pattern employed to optimize command processing by employing in-stream 'snapshot' events with the following properties:
    • no additional roundtrips to the store at either the Load or Sync points in the flow to facilitate snapshotting
    • support (via EventSum) for the maintenance of multiple co-existing snapshot schemas in a given stream