Coder Social home page Coder Social logo

rafaellx10 / complete-microservices-env Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliofalbo/complete-microservices-env

0.0 1.0 0.0 39.89 MB

This is a whole environment of a Microservices Architecture using Spring Cloud, Splunk, Zipkin, Grafana, Prometheus, Postgres with Replication Strategy, Redis and RabbitMQ.

Java 100.00%

complete-microservices-env's Introduction

Build Status

What are Microservices?

There are thousands of definitions out there about what are microservices, but the one I like best is that of the great master Martin Fowler

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.

James Lewis and Martin Fowler

What is this?

This is a whole environment of a Microservices Architecture. Here you can find the implementation of a lot of "fancy" patterns that we can find like CQRS, Distributed Lock, Domain Events, etc.

Bounded Context

ContextMap.png

Architecture Diagram

HotelBookingSystemArchitecture.png

Getting Started

Start

  • Clone the repository
  • Build the services
    • ./build.sh
    • Tip: Run this command and go to take a coffee... or 2...
  • Start the whole environment
    • ./start.sh

Note: If you want to build and run just call ./start.sh true

Stop

  • Stop all services keeping the volumes (preserving data)
    • ./stop.sh
  • Stop all services removing all volumes (it means that you will remove all data)
    • ./stop.sh true

Stack

  • RabbitMQ as a Message Broker
  • Feign to create REST Clients
  • Ribbon to Client Side Load Balance
  • Eureka to a Service Discovery
  • Sleuth and Zipkin to a Distributed Tracing
  • Hystrix to a Fault Tolerance
  • Prometheus as a Metrics Collector
  • Grafana as Metrics Analytics and UI
  • Postgres as Database
  • Flyway as Database Migration Tool
  • Splunk as Log Analysis Platform
  • Redis to handle Distributed Lock
  • Swagger to create an OpenAPI documentation

Ports

Application Port
Booking Microservice 8100, 8101, 8102
Searching Microservice 8200, 8201
Financial Microservice 8300
Frontend Microservice 8400
RabbitMQ 5672, 5673
RabbitMQ Admin UI 15672, 15673
Booking Postgres Master 5432
Booking Postgres ReadOnly Replica 5433
Financial Postgres 5434
Grafana 3000
Prometheus 9090
Splunk 8000
Netflix Eureka 8761
Zipkin 9411

Distributed Lock Test

In the root folder we have a file called CreateBookingConcurrencyTest.jmx. So, this is a JMeter that can be easily imported and the only thing that you should do is change the room id for the tests. With this test it is possible to see that the booking service is queuing the requests based on the distributed lock on Redis and treating the concurrency issue.

Links

TODO List

References

complete-microservices-env's People

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.