Skip to content

jenkem1337/grpc-event-sourcing-practice

Repository files navigation

Event Sourcing Project

Purpose Of Project

The purpose of this project is to learn the event sourcing architecture and its implementation, and to reinforce this knowledge with a simple shopping cart example

Architecture Of Project

  • Postgres is used for Event Store
  • Etcd is used for leader election to enable horizontal scalability for the snapshot service
  • gRPC is used for client-server communication

High Level Architecture

HighLevelArch

EventStore ERD

ERD

gRPC Service Definitions

ShoppingCartService

Method Name Explanation
createCart Creating new cart with user id
addAnItem Add new cart item if not exist in cart. Otherwise only increased cart item quantity
removeAnItem Decrease cart item quantity if cart item exist in shopping cart
removeItem Remove cart item from shopping cart
complete Complete shopping

ShoppingCartSnapshotService

Method Name Explanation
getLatestAggregateStateForSnapshot Getting snapshot needed aggregate state
saveSnaphot Save needed snapshots

Installation

  • Clone Repository
  git clone https://github.com/jenkem1337/grpc-event-sourcing-practice.git
  • Start
docker compose up --build

About

Event sourcing practice with Java, Postgresql, etcd, gRPC, Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published