Code Monkey home page Code Monkey logo

american-orange-cadillac's Introduction

American Orange Cadillac

A blueprint of Event-Driven Microservices

American Orange Cadillac is a simple accounting system, which exposes an API for opening accounts for existing customers. The API accepts information like customerId and initialCredit. Once the API is called, a new account will be opened connected to the customerId. Also, a new transaction is sent to the new account if the initialCredit is not 0. Another API is exposed to get account information with its transactions. We assume American Orange Cadillac has a large customer base and is still growing with new accounts and customers. And the system continuously requires to support all type of concurrent transactions for their accounts. Considering the fact that requirement for reliable, and scalable transactions handling system with high availability, the following microservices architecture is proposed.

Architecture Overview

The system is divided into two main services, AccountService and TransactionService. Alt text

The mains architecture reasoning behind the separation are;

  • AccountService and TransactionService are microservices, which has its unique scalability requirement. That is, the system should allow onboarding new accounts, and should not be affected by the performance of transaction handling.
  • TransactionService could be used by other parts of the system, which are only communicated over the commands/events.
  • AccountService publishes TransactionRequested command events, which is eventually recorded in the TransactionService.
  • TransactionService trigger TransactionCommit event once the transaction is recorded in the system.
  • Upon TransactionCommit event, AccountService update relevant account balance.
  • Event Source is a message broker which decouples the microservices AccountService and TransactionsService. The message broker can be a reliable distributed system like Kafka, but in this work, RabbitMQ is used for easy demonstrate.
  • AccountService and TransactionsService as microservices have its data source. H2 in-memory database is used in this work. In real work, each service may have a different database system to support its storage and transactions requirement. For example, TransactionService may expect high throughput of transaction events. A distributed storage system like Cassandra might be relevant for it as the database system.
  • As microservices, AccountService and TransactionService are fully decoupled by its design. AccountService follows the separate way pattern to avoid any integration with TransactionService.
  • The containerized microservices are expected to deploy on kubernetes. The microservices will follow Serverside Service Discovery with use of kubernetes Service descriptors.

american-orange-cadillac's People

Contributors

wpnpeiris avatar dependabot[bot] avatar

Watchers

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