Coder Social home page Coder Social logo

eloquenza / favs-project-event-driven-services Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 764 KB

A small group project to learn about "event-driven services and architecture", especially the concepts Event Sourcing (ES) and Command Query Responsbility Segregation (CQRS). A small e-commerce shop implemented as a series of microservices, built upon technologies like Spring Boot, Cloud and Apache Kafka. Part of the exam for the master's program module "Advanced aspects of distributed systems" (FAVS) at Hochschule Hannover, WS20/21.

Java 97.10% Dockerfile 0.92% Shell 1.99%

favs-project-event-driven-services's People

Contributors

eloquenza avatar

Watchers

 avatar

favs-project-event-driven-services's Issues

Add an installation / development guide

A document on how to use, interact, start or develop this software is needed. It should atleast contain the following topics:

  • How to compile
  • How to start
  • What software is needed prior to start/compile (i.e. software requirements like maven, java, ...)

Add more extensive code documentation

Currently there is a lack of code documentation because this project was hacked together very quickly.
We should add a bit of commentary, esp. to code parts with high (technical) impact.

Remove all TODOs

We might need to remove all TODOs from the comments if the professor would like so. This issue exists purely to track this.

Create a more understandable REST API route naming scheme

Currently, our REST API route naming scheme consists of:

/$resource-plural/v1/$resource-plural/{create, id}

This allows us to implement other versions and use the Spring Cloud Gateway to route the requests to the appropriate microservices.

Research some renown, widely used REST APIs on how they implement a consistent naming scheme, esp. considering versioning.

Some ideas:

  • URI versioning is fine, but not in the currently naming scheme, maybe use:
    /$resource-management/v1/$resource-plural/{create, id}
  • Implement some MIME type versioning, i.e. clients/server use a header like Accept: application/favs.commerce.customer.v1+json

Simplify the maven POMs

Currently, most of the POMs are very copy-paste due to the fast velocity of this project.
Extracting some of the dependencies and plugins into the parent POM makes this whole project more wieldable, and all children POMs more readable/configurable/handable/understandable.

Apply CQRS pattern to microservices

Currently, we have no form of CQRS in our system. To achieve this, some/all microservices need to be split into a command and a query part.

If we are not splitting all microservices because of some reason, we should first document that reason and explain why only some services have been split.

The following two would be a good idea to split at the least: CustomerService and ProductService.

High-level documentation/diagrams to explain how ES / CQRS are used

The document/diagrams should explain how Event Sourcing and Command Query Responsibility Segregation are used exactly and what they enable (code/technical-wise).
For example, this could showcase a sequence diagram on what happens when a user is creating his own account in our system, i.e. which services are interacting together, how does CQRS / ES help here.

Either in some form of an architecture.md [0] or ADRs [1].

[0] https://www.reddit.com/r/programming/comments/le46br/why_you_need_architecturemd/
[1] https://en.wikipedia.org/wiki/Architectural_decision

Create an usage guide

Create an document that describes how to interact with our system once it is started. It should atleast contain:

  • describing business use case
  • showcasing a few business work flows
  • define how to interact with the system: provide cURL / Shell scripts and show how to use GUI.
  • Write down that it is possible, that certain services might need a while before they are available. Docker-compose creating ... done does not mean, the service is started and reachable. Even after the log output ends, the gateway might need a while for the routing of requests -> concrete services takes hold.

Does not mean, that the service has crashed, only that it is currently unavailable due to routing of gateway being to slow (might a be local/machine thing, due to constrainted resources available).
{ "timestamp": 1615409020742, "path": "/customers", "status": 503, "error": "Service Unavailable", "message": "", "requestId": "fa12285a-1" }

Implement all CRUD functions for all entities

Currently, we only have create and retrieve (the C and R in CRUD) functionality for our entities (only R for product).

The other basic operations of managing and interacting with data should be implemented, too.

  • deleteCustomer
  • updateCustomer
  • deleteOrder
  • updateOrder

Atleast for the customer and order entities.
We could declare that our product entities are managed by some other form, i.e. an internal system which an warehouse worker uses to enter new products.

Improve the current mechanism to convert message payloads back to Java Objects

Currently, we need to write an MessageConverter for each Message.
Which does not seem appropriate considering the fact that this is a 1:1 relationship, i.e. for each event we need to write a new MessageConverter, which simply bloats amount of classes.
Ideally we would convert all our events back to simple POJOs, as Spring Cloud Stream seems to be able to convert these without problems from/to JSON.
But this does seem a bit backwards, as there definitely should be an easier way for this.

Find better way for converting events <-> json to avoid having to write an converter for each event.

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.