Containerized Microservices

Introduction

Backend services often contain many different functions in terms of development and maintenance, and each function also has different permission requirements.
In this article will explain the currently designed framework and introduce each function one by one.
And explain the database and server communication methods

Technical Map

Module Description

Gateway
  • Connection with client, Assign to other modules for processing based on actions
    Service can expansion according to the requirement
Logic Service
  • Responsible for processing logical actions
    Auto Scaling when the service is up to threshold
    To reduce single service usage
RPC Service
  • Responsible for processing Module and database transfer needs
    Reduce the coupling degree to the database
  • Batch insert when data is huge to reduce the risk of concurrent events
  • Receive service states for store and analysis
CronJob Service
  • Scheduled process of non-real-time of data needs
  • Analysis and classification data for subsequent statistical inquiries
API Service
  • Open interface for clients to obtain data

Service Structure

Divided into api service、main service、database service
Service can auto scaling based on each demand
To realize load balance and Blue Green Deployment etc.

Database

MariaDB
  • MaxScale
  • Replication
Redis
  • Cluster
  • Pub/Sub
  • RedLock

Protocol

TCP/IP
  • Single request from the client
WebSocket
  • long connection with client
gRPC
  • Service communication