Enterprise Microservice Platform and Operation - - PowerPoint PPT Presentation

enterprise microservice platform and operation experience
SMART_READER_LITE
LIVE PREVIEW

Enterprise Microservice Platform and Operation - - PowerPoint PPT Presentation

Enterprise Microservice Platform and Operation Experience Sharing Ivan Hsieh P .1 Agenda Microservice Architecture How to break a Monolith into Microservices


slide-1
SLIDE 1

P .1

企業微服務平台建置與維運經驗分享

Enterprise Microservice Platform and Operation Experience Sharing 謝逸凡 Ivan Hsieh

slide-2
SLIDE 2

P .2 2

Agenda

  • Microservice Architecture
  • How to break a Monolith into Microservices
  • Microservice Operation Monitor
slide-3
SLIDE 3

Developer Code Build Deploy

Monitor

Traditional Container Architecture Serverless( FaaS / BaaS )

Microservice Cloud Native Architecture

slide-4
SLIDE 4

Focus on Service Objective

  • 擴展企業規模
  • 支援進入新市場
  • 支援既有市場創新
  • 短時間交付新功能

服務目標 架構原則

  • 標準 REST
  • 封裝舊系統
  • 消除整合資料庫
  • 發佈整合模型
  • 獨立小服務
  • 快速部屬
  • 減少客製

設計與交付實 務

  • 降低慣性 加快上

版速度

  • 提高可用度,容

量可以快速調整

  • 服務使用重組
  • 資料快速整合處

理產生應用

slide-5
SLIDE 5

Characteristics of a Microservice Architecture

容易部屬 ,自動化

  • 一份程式代碼 多環境部屬
  • 環境配置檔案與程式代碼分開隔離
  • DevOps CICD
  • 獨立部屬
  • 開發環境與正式環境相同

技術的異質性

  • 專注服務
  • 組織調整,去中心化
  • 持續創新

韌性 高可用度

  • 失敗隔離 ,隔艙
  • 隱藏內部細節
  • 數據隔離,資料一致性
  • 一個或多個無狀態服務一起運行

擴展

  • 持久化資料都在外部,快速容量

擴展

  • 說明依賴關係並隔離管理依賴
  • 非同步架構

服務建構開發&運行

  • 服務重組
  • 後端服務當作附加資源
  • 透過網路API調用後端服務
  • 漸進式設計
  • Log / 管理監控機制
  • 快速重啟容器特性
slide-6
SLIDE 6

Microservice Architecture

6

Client App

WebApp

API Gateway

Identity micro service Catalog micro service

RDB Cache

Ordering micro service

RDB

Marketing micro service

NoSQL

Event Bus

slide-7
SLIDE 7

Microservice Build

服務切割越細可擴展性越強,彈性越好,複雜度也越高

  • 外 鬆耦合Loosely Couple
  • 內 高度聚合
  • 微服務邊界與介面 Boundary Context / Explicit Interface
  • 微服務間共用資料模型
  • 微服務隱藏細節
  • 不夠瞭解服務過早分解
  • 需要找到平衡點與自己的技術管理能力對齊
  • 不要想要㇐步到位
slide-8
SLIDE 8

3 Tier UI Business Logic Database UI Service Database Service Service ESB (Business Logic) UI API Service Oriented Micro Service

MS

Data base

MS

Data base

MS

Data base

MS

Data base

MS

Data base

Application Modernization

One Size fit all tight coupling Fine Grained components Loosely coupling SuperFine service Loosely decoupled

slide-9
SLIDE 9

AP Load Balancer AP AP Load Balancer AP AP AP Service1 Load Balancer Service2 Service3 Service1 Load Balancer Service2 Service3

Microservice Application Stateless

Service2

slide-10
SLIDE 10

Break a Monolith into Microservices

Service1 Service Service3 Monolith Service Service 4 Service2 Service Service3 Monolith Service Service 4 Service2 API

slide-11
SLIDE 11

Cache

Break a Monolith into Microservices - Database

Database Shading

service A

Read/Write splitting

service E

Master Slave Slave

Portal2

service A

Portal2

service B

Portal2

service C

Write Read

CDN

1~100 200~300

slide-12
SLIDE 12

Data Table FK

Break a Monolith into Microservices - Database

資料庫依賴問題

  • 打破FK
  • 公用靜態資料
  • 共用靜態資料庫
  • 共用資料表

Data Integrity Check

slide-13
SLIDE 13

Break a Monolith into Microservices - Database

Share Table Share Data

Read Only  Copy to each service  Property file Read/Write  Build a data service  Spilt Table

slide-14
SLIDE 14

Legacy Transaction Boundary

Database Two Phase Commit Java XA Database Two Phase Commit

DB Link DB Function

slide-15
SLIDE 15

Microservice A Event Bus (Push / Subscribe) Microservice B Microservice C

Microservice Transaction Boundary

API / Services Compensating Service bklog

Data Eventual Consistency (CAP)

  • 稍後再試
  • 終止交易
  • 分散交易
slide-16
SLIDE 16

Microservice Reporting & DW

Microservice

Database Service Queue Data Service Platform

Event Data Pump

ETL Cloud Native AP Database Legacy System Web ODS/DW ETL ETL Service Application Platform Application Modernization

Data Service API

Data Mark BI

Storage Clone

slide-17
SLIDE 17

Microservice Operation

  • Testing Policy
  • Deployment
  • DevOps CI CD
  • Service Mesh
  • Architecture
  • Deployment Enhancement
  • Error Handle
  • Log System
slide-18
SLIDE 18

Microservice Architecture

18

Client App

WebApp

API Gateway

Identity micro service Catalog micro service

RDB Cache

Ordering micro service

RDB

Marketing micro service

NoSQL

Event Bus

slide-19
SLIDE 19

Microservice Testing

Identity micro service Catalog micro service

RDB Cache

Ordering micro service

RDB

Marketing micro service

NoSQL

Build Unit Testing Service Testing Code Build Unit Testing Service Testing Code Build Unit Testing Service Testing Code Build Unit Testing Service Testing Code E2E Testing

  • 端到端測試複雜
  • Who is owner
  • 相互干擾
slide-20
SLIDE 20

Microservice Testing – Load Test

VU (Virtual User) 同時執行客戶數 TPS (Transaction Per Second) 每秒可執行的交易 RT (Response Time) 响應時間

VU (Virtual User) TPS RT CPU Best Loading Max Loading

  • 每次都要執行壓測 ?
  • 單元壓測
  • 服務壓測
  • E2E 壓測
slide-21
SLIDE 21

K8S Prod Cluster SIT Image Registry

Code Change/ Commit

V1 Image V2 Image Code V1

Trigger build code & test

Code V2

Push service image sync image Deploy request

Prod Image Registry

V1 Image V2 Image

K8S SIT Cluster

Service V1 Service V1

Exchange Pool

V1 Image V2 Image

sync image Release event

A10

Deploy request Pull image & deploy

Service V2 Service V2 Service V1 Service V1 Service V2 Service V2 Service V0 Service V0

Pull image & deploy

DevOps CI/CD - Docker

2 1

slide-22
SLIDE 22

Virtualization Container Container Orchestration Tools

Microservice Platform

slide-23
SLIDE 23

微服務間通信的基礎設施層,以Slidecar模式 與應用配合運行,負責服務之間的網路 調用、路由轉發、負載均衡、限流、熔斷和監 控。 Application

Core Functionality

Sidecar

Peripheral tasks such as:

  • Platform abstraction
  • Proxy to remove service
  • Logging
  • Configuration

Service Mesh Concept

slide-24
SLIDE 24

Application Sidecar

Service Mesh Concept

slide-25
SLIDE 25

Istio Service Mesh Architecture

Policy & Telemetry (Mixer) TLS Certs (Citadel) Control Plane

Sidecar (Envoy) App A Pod Service A Sidecar (Envoy) App B Pod Service B Sidecar (Envoy) App C Pod Service C

Kubernetes API

Secret Service Account Secret Secret Secret mTLS mTLS

Config Data (Pilot) Data Plane

jaeger

slide-26
SLIDE 26

Service Mesh Deployment

Service / Ingress V1 V2

Original Traffic Mirrored Traffic

Service / Ingress V1 V2

Shadow Bule /Green

slide-27
SLIDE 27

Service Mesh Canary Deployment

Service / Ingress Canary

Traffic split

V1 95% 5% Service / Ingress Canary

Contain Base

V1 User agent : iPhone User agent : Android

slide-28
SLIDE 28

Service Mesh Error Handle

Retry

Service / Ingress

Timeout 3S Delay 3S Return Error

  • Return Error
  • Retry times
  • Delay
slide-29
SLIDE 29

Service Mesh Error Handle

Circuit Break Service / Ingress

Time out or Error Hit Threshold Return error Break Service

Service / Ingress

Retry Hit Threshold Reconnect Service

slide-30
SLIDE 30

E2E Monitor

Business Transaction Hybrid IT Infrastructure Application Storage Web Database AP Server Network Server Call Center Store eService CRM ERP Ordering Billing

Use service E2E point of view to create a monitor

slide-31
SLIDE 31

AIOps Monitor

Time 0 12 24 CPU 100 50 Fix Threshold Vibrable Threshold (+- 10%) Add resource Alert & check root cause Threshold Actual

slide-32
SLIDE 32

Monitor Log Center – Service Trace

Web API Service Trace Business

啟用服務 開戶

A1 A2 A11 A6 B1 B2 B5 B7 C1 C5 D1 D2 S1 S3 S6 S9

A2 B2 C1 D1 B1 A1 B1 D1 B1 C1

A服務 S1 A2 B2 C1 D1 B1 A6 B7 C5 D2 B5

slide-33
SLIDE 33

Log Center

Web Trace ID Span ID Parent ID Host IP App name Service name End Time Elapsed time Return Code OPID Client IP Session ID API Trace ID Span ID Parent ID Host IP App name Service name Start Time Elapsed time Return Code Chanel code Protocol name APP Trace ID Span ID Parent ID Host IP App name Service name Start Time Elapsed time Return Code DB Trace ID Span ID Parent ID Host IP App name Service name Start Time Elapsed time Return Code DB Name SQL

slide-34
SLIDE 34

Log Center

Span ID : S001 Trace ID : T001 Parent ID Span ID : S002 Trace ID : T001 Parent ID : S001 Span ID : S003 Trace ID : T001 Parent ID : S002 Span ID : S004 Trace ID : T001 Parent ID : S002 Span ID : S005 Trace ID : T001 Parent ID : S003 End Time : 14:20:13:20 Elapsed time : 20 14:20:13:20 20 T001 Start Time : 14:20:13:01 Elapsed time : 7 7 14:20:13:09 14:20:13:01 8 6 14:20:15:10 14:20:13:19 4 S001 S002 S003 S004 S005 14:20:13:00 jaeger

slide-35
SLIDE 35

35

What’s Next

►Monitor & Log continue enhancement ►Automation for Microservice environment

►Use more Visualization tool to support operation

►cloud-native application on Service ,Data ,Container infrastructure ►Focus on service ►Not all in Microservice

slide-36
SLIDE 36