Show HN: Light implementation of Event Sourcing using PostgreSQL as event store

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Onboard AI - ChatGPT with full context of any GitHub repo.
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern API for authentication & user identity.
  • postgresql-event-sourcing

    A reference implementation of an event-sourced system that uses PostgreSQL as an event store built with Spring Boot. Fork the repository and use it as a template for your projects. Or clone the repository and run end-to-end tests to see how everything works together.

  • commanded

    Use Commanded to build Elixir CQRS/ES applications

    This reminds me of Commanded[0] for elixir which also uses Postgresql by default.

    [0]https://github.com/commanded/commanded

  • Onboard AI

    ChatGPT with full context of any GitHub repo. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at app.getonboardai.com.

  • message-db

    Microservice native message and event store for Postgres

    I’m addition to the alternatives mentioned, here’s another Postgres-only ES implementation: https://github.com/message-db/message-db

  • ksqldb-event-souring

    Discontinued Kafka is not for event sourcing, isn't it? Kafka alone is not an event store, but Kafka and ksqlDB together allow building full-featured event stores. This repository provides a sample of event sourced system that uses Kafka and ksqlDB as event store.

    I tried to evaluate Kafka usage for event sourcing: <https://github.com/eugene-khyst/ksqldb-event-souring>. More out of curiosity. But never tried it in production.

  • txid-syncing

    Demo of continuous syncing based on txids

    Nice job, eugene-khyst. Looks very comprehensive from an initial skim.

    I've worked on something in the same space, with a focus on reliable but flexible synchronization to many consumers, where logical replication gets impractical.

    I have a mind to do a proper writeup, but at least there is code at https://github.com/cognitedata/txid-syncing (MIT-licensed) and a presentation at https://vimeo.com/747697698

    The README mentions …

    > A long-running transaction in the same database will effectively "pause" all event handlers.

    … as the approach is based on the xmin-horizon.

    My linked code works with involving the MVCC snapshot's xip_list as well, to avoid this gotcha.

    Also, note that when doing a logical restore of a database, you're working with different physical txids, which complicates recovery. (So my approach relies on offsetting the txid and making sure the offset is properly maintained)

  • Marten

    .NET Transactional Document DB and Event Store on PostgreSQL

    Check out Marten for a fully fleshed out implementation https://github.com/JasperFx/marten

  • sirix

    SirixDB is an an embeddable, bitemporal, append-only database system and event store, storing immutable lightweight snapshots. It keeps the full history of each resource. Every commit stores a space-efficient snapshot through structural sharing. It is log-structured and never overwrites data. SirixDB uses a novel page-level versioning approach.

    I'm working on an append-only (immutable) (bi)temporal DBS[1] in my spare time, which transforms CRUD operations into an event store, automatically providing an audit log for each stored node, while the nodes are stored with immutable node-IDs, which never change. As the contents stored are based on a custom binary JSON format also a rolling hash can optionally be built, to check if a whole subtree has changed or not.

    The system uses persistent index data structures to share unchanged pages between revisions.

    The intermittant snapshots are omitted. Rather the snapshot is spread over several revisions, applying a sliding snapshot algorithm on the data pages (thus, avoiding write peaks, while at max a predefined number of page fragments has to be read in parallel to reconstruct a page in-memory).

    [1] https://sirix.io | https://sirix.io/docs/concepts.html

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • eventstoredb-event-sourcing

    Discontinued EventStoreDB is the database for Event Sourcing. This repository provides a sample of event sourced system that uses EventStoreDB as event store.

    I can definitely recommend EventStoreDB. I used it in production and most colleagues like this DB. I have a sample Java Spring Boot + EventStoreDB project <https://github.com/eugene-khyst/eventstoredb-event-sourcing>.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts