Git Product home page Git Product logo

modular-monolith-restaurant's Introduction

Modular Monolith architecture status

...in Egg Restaurant

logo

Architecture

This project is an example of Modular Monolith with Onion Architecture. Communication between the modules is implemented with events and Event Bus. Onion Architecture is based on 3 layers:

  • domain - bussines requirement
  • application - frameworks, services, technology specific code
  • infrastructure - other systems like DB, JMS, REST API

Check Jeffrey Palermo's blog to learn more about Onion Architecture!

schema

Check also Robert C. Martin's blog post about clean architecture!

Domain is in the heart of software and with this approach we can achieve loosely coupling between modules. If the business is mature then the domain module will stay unchanged. So when the framework became rusty and the team decide to change technology it will have no impact on business code. The same perfomance/integration changes.

Monolith First!

The first step to deliver distributed system should be Modular Monolith, since Microservices requires much more infrastructure effort. Additionaly business domain must be stable because changes between the modules are difficult to implement.

Event Bus

Event Bus is a subset of Publish-Subscribe patterns. It's a combination of Observer and Mediator pattern. It's implementation can vary in other languages and frameworks, here's my Java example.

Event Bus is an architectural pattern it's used in distributed asynchronous architecture to create highly scalable reactive applications. It provides loosely coupling between different components.

schema

Check Microsoft page

Egg Domain...

schema

The domain is based on restaurant which serves eggs.

No Database

The project contains only InMemory Repository since it is used only for learning purposes.

Modules

├─┬ eggrestaurant
│ ├── commons
│ ├── cooking
│ ├── restaurant
│ └── wash

Contexts

Domain is based on 3 subdomains since egg means something else for different actors.

  • for customer egg means something to eat.
  • for cook it means an ingredient to make a meal.
  • for dishwasher it means nothing else but ugly slush to wash...

schema

Inspiration

Inspiration based on Wade Waldron's talk: "Domain Driven Design and Onion Architecture in Scala" on Scala Days 2016

modular-monolith-restaurant's People

Contributors

mcwiekala avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.