Code Monkey home page Code Monkey logo

event-sourcing-kafka-streams's People

Contributors

amitayh avatar nicusx avatar

Watchers

 avatar  avatar

event-sourcing-kafka-streams's Issues

Docker-Compose stack

Add a Docker-Compose stack with

  • Kafka
  • ZooKeeper
  • MySQL

Create the db schema and set db user directly in the container

Use Schema Registry

Add support for Schema Registry.
Add Schema Registry to the Docker Compose stack (depends on #1)

Does this require replacing Avro4S? Probably.

Allow multiple instances of each service

At the moment, the implementation assumes there is a single instance of each service: Command Handler, List Projector, Web Server

Allow scaling out each service type.

This probably requires specifying the consumer group.
It also probably requires modifying the web service: at the moment POST, /execute/{invoiceId} listen to the command result topic waiting for the result corresponding to the commandId.
This assumes a single instance of the service or a single-partition topic for Command Results.
One possible simple solution may be using a different consumer group per service instance. This way all instances will consume all partitions.

Rebuild snapshots from events

Provide the ability to rebuild the snapshots topic from scratch, consuming all events.
This should happen on demands only and not while the command handler is running.
Probably a separate application.

A dumb implementation might assume the snapshot topic is empty end re-consume all events from the beginning of the time.
A smarter implementation should consume both snapshots and events streams, only applying events starting from the version of the latest snapshot (+1)
(remember: the Event version is the version of the Snapshot it is supposed to be applied to)

Build Snapshot state from the events stream

Currently, CommandHandler update the stateful Snapshot table as a side effect of processing commands.
This sounds quite wrong and does not provide the ability to rebuild the snapshots from scratch and make sure the snapshot stream is consistent with the stateful Snapshot table.

The actual process should be the following:

  1. Applying a Command to the current state generates a Command Result: either a failure or Event(s). Both CommandResults and Events are materialised as Topics.
  2. Applying events to the current Snapshot generate the new Snapshot.
  3. The new Snapshot update the stateful Snapshot table and is also materialised as a Topic

This is the same process described here

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.