Giter Club home page Giter Club logo

aman-agrawal-coolblue / flowing-retail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from berndruecker/flowing-retail

0.0 1.0 0.0 38.06 MB

Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

License: Apache License 2.0

Java 76.29% HTML 2.70% JavaScript 1.53% Batchfile 2.47% C# 6.70% Dockerfile 0.69% Go 4.67% Smarty 4.94%

flowing-retail's Introduction

Flowing Retail

This sample application demonstrates a simple order fulfillment system decomposed into multiple independant components (e.g. microservices).

There is code for multiple implementation alternatives to allow a broad audience to undestand the code or to compare alternatives. The table below lists these alternatives.

The example respects learnings from Domain Driven Design (DDD), Event Driven Architecture (EDA) and Microservices (µS) and should give you a very hands-on access to certain topics.

Note: The code was written in order to be explained. Hence I favored simplified code or copy & paste over production-ready code with generic solutions. Don't consider the coding style best practice! It serves the purpose to have easily explainable code.

Flowing retail simulates a very easy order fulfillment system:

Events and Commands

Architecture and implemenation alternatives

The most fundamental choice is to select the communication mechanism:

  • Apache Kafka as event bus (could be easily changed to messaging, e.g. RabbitMQ):
  • REST communication between Services
    • This example also shows how to do stateful resilience patterns like stateful retries leveraging a workflow engine
  • Zeebe broker doing work distribution

Having chosen that your probably can choose the workflow engine:

  • Camunda BPM 7
  • Zeebe (if you are interessted why Zeebe is listed in the communication mechanism as well as workflow engine please look into the Zeebe example readme)

and the programming language:

  • Java
  • Go

Storyline

Flowing retail simulates a very easy order fulfillment system. The business logic is separated into the services shown above (shown as context map).

Long running services and orchestration

Some services are long running in nature, as e.g. the payment service ask customers to update expired credit cards. Hence a workflow engine is used to persist and control these long running interactions.

Workflows live within service boundaries

An important thought is, that this state machine (or workflow engine in this case) is a library used within one service. If different services need a workflow engine they potentally run multiple engines. This way it is an autonomous team decision if they want to use some framework and which one:

Events and Commands

Resilience patterns for synchronous communication

Depending on the means of communication (e.g. messaging vs. blocking synchronous REST calls) you also have to tackle quite basic communication problems, e.g. by stateful retries.

V1

Links and background reading

flowing-retail's People

Contributors

berndruecker avatar robvdlv avatar

Watchers

James Cloos avatar

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.