Giter VIP home page Giter VIP logo

bank-demo's Introduction

A modern microservice based application

This is a demo banking applicaiton built around modern technolgies. The key pillars of this application are:

  • Self-contained microservices deployed into Kubernetes
  • Polyglot applicatoin with microservices written in different languages and communicate with each other over standard network protocols.
  • Every microservice supports observability with metrics and distributed tracing. Use opencensus and Prometheus to be compatbile with both on-premise stack with Jaeger, Prometheus and Elastic; or Stackdriver in GCP.
  • Use Istio service mesh to perform traffic management within and inter kubernetes clusters
  • High performance inter microservice communication with gRPC. The gRPC services can be directly exposed to external client or use Envoy gRPC-Web filter for clients that do not support HTTP/2 natively.

architecture diagram

Modules in this repo

Directory Language Conent
protos protobuf protobuf API definition used in all across the application.
dashboard Go dashboard microservice, calls casa-account services, either v1 or v2, controlled by istio virtualservice configuration
customer-v1 Java customer microservice built using spring boot. It reads customer data stored in MySQL
casa-account-v1 Java casa account microservice built using micronaut framework. It reads account data stored in Cassandra
casa-account-v2 nodejs casa account microservice, only returns dummy data.
ext-cust-svc python a simple http server written using aiohttp to mock an external REST server that provides customer info
load-generator python uses Locust to generate API calls
testdata python generates test data and write them to Cassandra
istio yaml istio manifest files to traffice management
gcp shell script and manifests to provision GKE cluster.

Requirement

The code in this repo has been tested with minikube and GKE. Details below

Local Minikue

Google Kubernetes Engine

Development Tools:

Run with minikube

Below are steps tesed on Ubutnu Bionic and Focal, should work on other linux flavors too.

Get prerequites first

  1. Install minikube
  2. Download Istio from 1.4.8 from Istio release pages from Github
  3. Install Skaffold
  4. Get Evans gRPC utility from Github release pages

first, then

#
# the k8s and istio versions below matches to versions in GKE's regular channel
#

# start minikube. for 
minikube start \
   --driver=kvm2 \
   --disk-size='30000mb' \
   --cpus='2' \
   --memory='12000mb' \
   --kubernetes-version='1.16.8'

# install istio with auto mTLS enabled
cd istio-1.4.8
bin/istioctl manifest apply --set profile=demo \
  --set values.global.mtls.auto=true \
  --set values.global.mtls.enabled=true

# istio takes sometime to get installed, wait till all the 
# pods are in Running status

# expose port 31400 for use grpc services
# this port is enabled on GCP and later versions of Istio
kubectl patch svc istio-ingressgateway -n istio-system \
--type='json' \
-p='[{"op":"add","path":"/spec/ports/0",  value: {"name": "tcp", "port":31400,"targetPort":31400, "protocol":"TCP"}}]'

#
# come back to this directory and run all the services 
# the script should build and start microservices
./deploy

# if all goes well, you should see output similiar to the one below
{
  "customer": {
    "customerId": "10001000",
    "loginName": "10001000"
  }
}

Roadmap

  1. better integration of logging and tracing. ability to navigate from trace to log with high accuracy. (implemeneted logic for adding data to trace span, and use custom data, e.g. login_name to search trace span. same custom data is added to log entries)
  2. use an external OpenID Connect provide for authentication.
  3. enable mTLS for inter microservice communication. (done)
  4. use Istio for oauth token validation

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.