How jet/equinox works
Overall project type and purpose
• Equinox is not a framework but a collection of composable libraries that implement the core event sourcing “decider” pattern along with plug‑in adapters for various backing stores (in‑memory, CosmosDB, DynamoDB, EventStoreDB, SQL‐backed stores, MessageDB). It also includes serialization support via FsCodec and a number of sample and tool projects.
• Its main goal is to enable the creation of scalable, cache‑friendly, production‐ready event sourcing solutions that can support snapshots, optimistic concurrency control, and efficient queries against different persistent stores.
File structure and identify the main components
• Top‑level components:
– Root-level solution and build files (Equinox.sln, build.proj, build.ps1) for compiling multi-targeted NuGet packages.
– Source directory (“src”) which holds the core libraries. Look for separate subfolders for:
– Equinox.Core: Implements shared utility types (e.g. batching, TaskCell, retry logic, caching).
– Store adapters: Subdirectories like Equinox.MemoryStore, Equinox.CosmosStore (and its Prometheus variant), Equinox.DynamoStore (with Prometheus), Equinox.EventStore, Equinox.EventStoreDb, and Equinox.SqlStreamStore (with MsSql, MySql, Postgres) plus Equinox.MessageDb.
– Equinox: Likely the main business logic contracts, including the decider’s API.
• Additional support:
– Tools (in “tools” folder) that provide command‑line capabilities (Equinox.Tool, Equinox.Tools.TestHarness).
– Samples under “samples”: Several sample applications (for example, TodoBackend, Store, Tutorial, and a Web sample) illustrate how to integrate the library into full‑stack systems.
– Tests under “tests” ensure that load tests and integration tests run against all supported store implementations.
Modeling the key components
a. Core Equinox libraries as one large “module” for event sourcing. Within it, identify sub‑components such as:
– The core decider/stream API (managing state folding, snapshotting, and concurrency control).
– The caching and batching modules in Equinox.Core.
– Equinox.MemoryStore – a volatile in‑process store used for testing.
– Equinox.CosmosStore (and its Prometheus metrics add‑on) – handling the “Tip” document and unfolding snapshots.
– Equinox.DynamoStore – following a pattern similar to CosmosStore but adapted to DynamoDB’s API and characteristics.
– Equinox.EventStore and Equinox.EventStoreDb – for interfacing with EventStoreDB (using the modern gRPC protocols).
– Equinox.SqlStreamStore (with connector variants for MsSql, MySql, Postgres) – a SQL‑backed approach.
– Equinox.MessageDb – if using MessageDB in Postgres.
c. Serialization support (FsCodec space) as a shared library that each store adapter depends on.
d. External tooling and sample applications:
– The sample projects (TodoBackend, Store, Tutorial, Web) that demonstrate usage of deciders and event sourcing.
– The Equinox.Tool and related utilities used for load testing, initialization of databases (Cosmos, Dynamo, SQL) and operational tasks.
e. Optionally, show the relationship to complementary systems such as Propulsion (mentioned in the readme) that provides projection and reactor-side functionality.
Relationships and interactions
• That the serialization libraries (FsCodec) are “used by” both the core Equinox package and by all store adapters.
• Optionally, include separate paths or “lanes” for control flows such as:
– Snapshot/unfold management (e.g., within CosmosStore, the Tip concept that holds unfolds).
– Metrics reporting (connecting Prometheus-enabled components to a metrics sink).
Architectural patterns and design principles to capture
• Separation of concerns—you have a core, store‑agnostic event sourcing library (Equinox) that is then “composed” with store‑specific adapters.
• Application of Domain‑Driven Design (DDD), the decider pattern, and support for idempotency and optimistic concurrency.
• Use of a “Plug‑in” architecture; for any new store, the same Equinox abstraction can be reused.