Git Product home page Git Product logo

microservices-synchronous's Introduction

Synchronous Microservices

An example of microservices that house and run their own data themselves. You can call the individual people, client, inventory, or sale APIs for CRUD operations. They are all "synchronous" as far as getting their data immediately from the API. We are using several programming languages and database engines on purpose to show that APIs do not care what language you run behind the API contract. Just that the contract is right! We have the following APIs within this project:

  • people API for CRUD on people with .NET Core and MSSQL Server Express Linux
  • client API for CRUD on clients with Golang and MySQL (these are basically companies)
  • inventory API for CRUD on inventory with NodeJS and PostgreSQL
  • sale API for CRUD on sales with Java Spring Boot and MongoDB
  • reporting API (works for single saleId) for read-only access on data from the above, i.e. sale linked to inventoryId, personId, and clientId for reference with the full recordset for each sale. Assuming one item per sale for simplicity. This is the one that ties it all together.

Setup

Feel free to clone and/or download this and use as you will. If there are edits you can certainly hit me up, make issues, do PR's, etc. No "man" is an island...

  • You can run each API separately by having the runtimes and pulling down the projects to run within each folder. Be careful as all are set to port 8080 by default. Feel free to change that. I left them on purpose to show port translation later.
  • There is a single docker-compose.yml file to run 'docker-compose up -d' if you want to spin up all containers and have them communicate. Note the environment pieces within the main docker-compose as it links to other containers by name.
  • You must seed the Clients API with a POST to add an initial client/company. See the README in that api folder for more information.
  • You must seed the Sales API with a POST to add an initial sale. See the README in that api folder for more information.

If you want to build the images and then run docker-compose up -d

  • run 'build-api-images' sh or cmd as appropriate based on your OS.

Building the Database Containers

  • run 'build-database-images' sh or cmd as appropriate based on your OS.

API Calls

See the relevant folders for the separate README files and API calls. Also each API (outside of the Golang API) has swagger 2.0 documentation that you can use and follow. The folders have README.md files in them to explain each API independently a little more in depth.

DB Structure

See the relevant folders for the separate README files and database structure. All databases are designed to run within containers with startup SQL scripts or schemas already built for the microservices.

ToDo's still

  • Document better, including https://www.draw.io/ documentation via images
  • Implement GitOps with Jenkins to auto-deploy locally with changes and webhooks
  • Messaging for eventual consistency of data
  • Istio implementation for service mesh design
  • Event Driven Architecture
  • Implement /_/health checks for the APIs and subsystems

microservices-synchronous's People

Contributors

dalebingham 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.