All Projects → bringmeister → Event Sourcing With Kotlin

bringmeister / Event Sourcing With Kotlin

Licence: mit
A demo project to show Event Sourcing with Kotlin.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Event Sourcing With Kotlin

Symfony 5 Es Cqrs Boilerplate
Symfony 5 DDD ES CQRS backend boilerplate
Stars: ✭ 759 (+1514.89%)
Mutual labels:  event-sourcing, ddd
Christddd
🙌 ASP.NET Core 3.1 应用, 包含 DDD、CQRS、EDA 和ES事件回溯
Stars: ✭ 510 (+985.11%)
Mutual labels:  event-sourcing, ddd
Resolve
Full stack CQRS, DDD, Event Sourcing framework for Node.js
Stars: ✭ 460 (+878.72%)
Mutual labels:  event-sourcing, ddd
Eventsourcing
A library for event sourcing in Python.
Stars: ✭ 760 (+1517.02%)
Mutual labels:  event-sourcing, ddd
Wolkenkit
wolkenkit is an open-source CQRS and event-sourcing framework based on Node.js, and it supports JavaScript and TypeScript.
Stars: ✭ 880 (+1772.34%)
Mutual labels:  event-sourcing, ddd
Akkatecture
a cqrs and event sourcing framework for dotnet core using akka.net
Stars: ✭ 414 (+780.85%)
Mutual labels:  event-sourcing, ddd
Event Store
PHP 7.4 EventStore Implementation
Stars: ✭ 505 (+974.47%)
Mutual labels:  event-sourcing, ddd
Eventually Rs
Event Sourcing for Rust
Stars: ✭ 277 (+489.36%)
Mutual labels:  event-sourcing, ddd
Rails event store
A Ruby implementation of an Event Store based on Active Record
Stars: ✭ 947 (+1914.89%)
Mutual labels:  event-sourcing, ddd
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+13112.77%)
Mutual labels:  event-sourcing, ddd
Go Api Boilerplate
Go Server/API boilerplate using best practices DDD CQRS ES gRPC
Stars: ✭ 373 (+693.62%)
Mutual labels:  event-sourcing, ddd
Eventhorizon
CQRS/ES toolkit for Go
Stars: ✭ 961 (+1944.68%)
Mutual labels:  event-sourcing, ddd
Ddd Leaven Akka V2
Sample e-commerce system #Microservices #Akka #Reactive-DDD #CQRS
Stars: ✭ 362 (+670.21%)
Mutual labels:  event-sourcing, ddd
Ultimate Backend
Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
Stars: ✭ 978 (+1980.85%)
Mutual labels:  event-sourcing, ddd
Akka Ddd
Akka CQRS/ES framework
Stars: ✭ 330 (+602.13%)
Mutual labels:  event-sourcing, ddd
Kledex
.NET Standard framework to create simple and clean design. Advanced features for DDD, CQRS and Event Sourcing.
Stars: ✭ 502 (+968.09%)
Mutual labels:  event-sourcing, ddd
OpenCQRS
.NET Standard framework to create simple and clean design. Advanced features for DDD, CQRS and Event Sourcing.
Stars: ✭ 546 (+1061.7%)
Mutual labels:  ddd, event-sourcing
Event Sourcing Cqrs Examples
Event Sourcing and CQRS in practice.
Stars: ✭ 265 (+463.83%)
Mutual labels:  event-sourcing, ddd
Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+10793.62%)
Mutual labels:  event-sourcing, ddd
Pitstop
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
Stars: ✭ 708 (+1406.38%)
Mutual labels:  event-sourcing, ddd

Event Sourcing with Kotlin

Build Status License

This is a simple demo project to show Event Sourcing with Kotlin.

Note that this project is derived from ddd-with-kotlin which shows a similar demo but without event sourcing.

Run it

./gradlew bootRun

Then open the web UI in a browser:

http://localhost:8080/index.html

You can submit requests there and see all events.

Example Use Case

The subject of this demo is the Product Service. The Product Service is located between five other components. The Master Data Service will push new products to the Product Service. This is the beginning of our business process. The Product Service will register each new product at the Media Data Service. After a product is registered, the Product Service will receive updates for this product from the Media Data Service. After an update was received, the Product Service will:

  • Update the CDN if media data has changed
  • Update the Shop and search index if master data has changed
+-------------+
| Master Data |
|   Service   |
+-------------+
   |                     << DEMO >>   
   +------------------► +---------+
    1: update product   | Product |
                        | Service |---------+---------+
               +------► +---------+         |         |
      3:       |             |      2:      |         |        5:
 push updates  |             | register new |         | update if master 
               |             |   product    |         | data has changed
   +------------+            |              |         |
   | Media Data | ◄----------+              |         +----------+
   |  Service   |                           |         |          |
   +------------+        4: update if media |         |          |
                          data has changed  |         |          |
                                            ▼         ▼          ▼
                                         +-----+  +------+  +--------+ 
                                         | CDN |  | Shop |  | Search |
                                         +-----+  +------+  +--------+

What to see

  • A domain entity called Product.kt which encapsulates business logic and throws domain events.
  • A process flow with events ("something has happened") and commands ("now do something").
  • Value objects such as ProductNumber.kt or ProductInformation.kt.
  • A ports-and-adapters package layout.
  • An anti-corruption layer for external messages - they will be transformed to internal commands.
  • A persistence based on event sourcing with a simple in-memory event store.

Important Concepts

Messages, Commands and Events

  • External systems (such as the Master Data Service or Media Data Service) communicate via messages. Those messages will trigger one or more actions in our system. Since those messages are not fully under our control (external systems are always evil!), we don't want to hand them to our business layer. Instead, we treat those messages as DTOs and translate them to internal commands (anti-corruption layer).
  • Every action taking place in our system is triggered by a command. Commands define our internal API.
  • When something has taken place, an event is published. Since we are doing event sourcing, events hold all data relevant to their context. We persist those events in order to construct our domain objects.

Application Layer vs Domain Layer

  • The application layer contains services. Those services glue together different components. However, they don't execute any business logic on their own. Instead they delegate this to the domain layer. A good example is the ProductService.kt.
  • The domain layer is the place where business logic is implemented. Domain entities (such as Product.kt) encapsulate data and business methods to (operate on that data). The domain layer should be independent of frameworks (as far as possible).

Resources

On Event Sourcing

On DDD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].