Giter Club home page Giter Club logo

baking-microservice-pie's Introduction

Baking a Microservice Pi(e)

This is the code of the demos for the "Baking a Microservice Pie" talk given by @radcortez and @agoncal.

The idea of the talk and the code, is to slowly build an entire microservice architecture (and deploy it on a cluster of Raspberry Pi). It is based on a DVD/CD/Book store where you can search for items, buy them (using a shopping cart) and see the inventory stock. But the code here has less functionalities.

Its genesis comes from the Tomitribe talk: Microprofile JCache

Slides

To get the slides of this presentation, just generate them by doing a mvn clean process-resources under the slides directory. The slides will then be generated under setup/target/generated-docs/slides.html.

Use cases

Anonymous user

Anybody can browse the catalog of CDs, Books and DVDs.

Anonymous user use-case

Customers

Once logged-in, an anonymous user becomes a customer. A customer can add, remove, browse and check-out the items of his/her shopping cart. The customer can also change his/her profile. Each time items are sold, the inventory is updated.

Customer use-case

Administrators

Administrators can create, update, delete items (CDs, DVDs, Books). A new item needs a number (ISBN, UPC, EAN or GS1). Each time an items is created of deleted, the inventory is updated.

Administrator use-case

Architecture

Technology used

Raspberry Pi cluster

Structure of the GitHub repository

Structure of the demos

This talk has several demos. Each one builds on top of the other. For example, Demo02 is built on Demo01 but brings the solution to a problem (eg. How do we register microservices ?). The last Demo folder (.i.e Demo99) is the final application, up and running.

  • Demo01 : We build a single very simple microservices (number-api) that generates a book number. It has a user interface.
  • Demo02 : We build several microservices (DVD, CD, Book, ShoppingCart, NumberGenerator and Inventory). Each service depends on another one. Problem: The URLs are hard coded.
  • Demo02 : We add a registry service so that each microservice car register itself and discover the others. Problem: How can we scale.
  • Demo03 : We need a client load-balancer so each microservice can choose from several instances of another service. Problem: Now we have services everywhere, how do we monitor them.
  • Demo05 : We need centralized monitoring. Problem: we need to secure these services with JWT in a centralize way.
  • Demo06 : We need a centralized gateway dealing with authentication. Problem: under load, some services do not answer and block the other.
  • Demo07 : We need to implement the circuit breaker pattern. Problem: Debugging is hard, we are lost between all services calls.
  • Demo08 : We need a tracking system
  • Demo99 : Final application

Structure of the code

+-- services
|   +-- book-api
|   |     +-- src
|   |       +-- main
|   |       +-- test
|   +-- number-api
|   |     +-- src
|   |       +-- main
|   |       +-- test
+-- clients
|   +-- angular application
|   +-- jax rs client to test services
|   +-- curl commands
+-- deployment
|   +-- ansible scripts
|   +-- docker config
+-- infra
|   +-- consul
|   +-- elk

Pre Requisites

Several tools are needed to make this code work

References

baking-microservice-pie's People

Contributors

agoncal avatar radcortez avatar

Watchers

James Cloos avatar Ionel Manolache 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.