Giter VIP home page Giter VIP logo

eugene-khyst / postgresql-event-sourcing Goto Github PK

View Code? Open in Web Editor NEW
968.0 968.0 84.0 1.64 MB

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.

License: Apache License 2.0

Java 99.43% PLpgSQL 0.57%
cqrs ddd event-driven event-driven-architecture event-sourcing event-store eventsourcing postgres postgres-notifications postgresql solution-architecture

postgresql-event-sourcing's Introduction

Hi there ๐Ÿ‘‹

My name is Eugene Khyst. I am a Principal Software Engineer and Software Architect and creator of ArtistAssistApp - the best free painting assistant tool ๐ŸŽจ๐Ÿ–Œ๏ธ

LinkedIn profile URL

GitHub followers GitHub user's stars

Stack Exchange reputation

Favorite tech stack

Java Spring Boot

JavaScript TypeScript Node.js NestJS React Ant Design Next.js Tailwind CSS

Apache Kafka RabbitMQ PostgreSQL Redis

Docker Kubernetes Nginx

Prometheus Grafana

Mocha TestCafe k6

Favorite methodologies

Agile Kanban Lean

postgresql-event-sourcing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

postgresql-event-sourcing's Issues

My project may also be interesting

Hi,

first of all, awesome work :-)

couldn't find your e-mail address, but I'm working on a (bi)temporal DBS[1] in my spare time, which basically also tracks changes and stores the results of CRUD operations, creating new revisions on each trx commit by appending data to an indexed log (thus, also no WAL is needed -- also due to the limitation of a singe writer per resource).

It avoids long chains of having to apply incremental deltas with intermittant snapshots through a sliding snapshot algorithm.

You can't alter the history, but of course revert to an old revision, add commit messages, track changes to specific nodes or even subtrees, as it optionally stores a rolling hash...

Thought since a couple of years, that it kind of brings temporal "tables" (binary JSON resources actually) and event stores one step closer.

Kind regards and a nice week
Johannes

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

Build Spring Boot image for arm64 architecture

In case someone is running this project on a M1/M2 Apple chip, this will enable building the image for the correct architecture:

Replace the jib configuration from the build.gradle file from event-sourcing-app with:

jib {
    to {
        image = "eugene-khyst/postgresql-event-sourcing:${project.version}"
    }
    from {
        image = "eclipse-temurin:21-jre"
        platforms {
            platform {
                architecture = 'arm64'
                os = 'linux'
            }
        }
    }
}

Separate ES-related infrastructure code from application code

Currently the application code is entangled with the generic ES-related infrastructure code, e.g. the enums EventType and AggregateType are pulling-in domain-specific code into the generic EventRegistryand AggregateRegistry implementations.

For a simple example this is ok, but for a template of a production-grade application this could be improved - maybe by aligning to the architecture approach of Clean Architecture (as Tom Hombergs describes it in his blog post Hexagonal Architecture with Java and Spring and his book Get Your Hands Dirty on Clean Architecture ).

So I would like to suggest refactoring the ES-related infrastructure code from the application into it's own package or module.

Does this work with two writers?

Let's say I have two instances of the service. Both services are creating events. When using postgres, it's possible for there to be gaps in the bigserial id used for the event table.

For example, it's possible for there to be visible id's 0, 1, 3, 4, 5 while the other service is still in the process of getting an event committed with id 2.

Adopt aspects from Eventuous (The Right Way)

I really like your fully end-to-end approach with its thorough design and documentation. Great work.

But I would love to see in your solution the adoption of some aspects of Alexey Zimarevs The Right Way and its C# library Eventuous, e.g.

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.