什麼是架構?
“The software architecture of a system is the set
of structures needed to reason about the system.
These structures comprise software elements,
relations among them, and properties of both.”
- Len Bass, Paul Clements, Rick Kazman
Software Architecture in Practice
“The fundamental concepts or properties of a system in its environment
embodied in its elements, relationships, and in the principles of its design
and evolution.”
- ISO/IEC/IEEE 42010:2011
“Architecture should speak of its time and place but yearn for
timelessness.”
- Frank Gehry
現有資訊架構位置 - 依非功能面考量
Where?
考量專案非功能需求,業務情境和可
能使用量,依解決方案限制與現有平
台情況決定使用何種平台和技術,並
非容器就比較好,虛擬機就比較差。
IaaS
A Overview of Enterprise IT Technology Architecture
Enterprise API Management
Enterprise Gateway
Web/Mobile Services Partners
Traffic
Outer API
BFF Service
Application
Server
Application
Service
PaaS
Managed Container System
MeshProxy
Inner API
Miniservice
Proxy
Inner API
Miniservice
Proxy
Inner API
Miniservice
Proxy
Inner API
Miniservice
Administration
Portal
Consumers
Channel
Inner API
Service
Inner API
Service
Application
Service
Inner API
Service
Platform API Management
Microgateway
IoTs ChatBot
Enterprise Service Bus
ODS TMS BaNCS CardLink IFX Accounting G/L
DB Pool
DB Pool
Here? Or here?
VM Container
Business Domain Map
架構風格 - 依非功能需求決定服務顆粒度
Spectrum of Options for Microservices Architecture
Greater development agility, increased deployment flexibility, more precise scalability
Data Store Data Stores
Monolith Macroservices Miniservices Microservices
Monolith
Runtime
Monolith
Runtime Runtime
Data Store Data Store
Service Service
Service Service
Runtime Runtime
Data Store
Greater data integrity, lower architectural complexity
Service Service
Service
RT
Service
RT
Service
RT
Service
RT
微服務忌妒:除非單體式或Miniservices無法滿足非功能需求,避免不熟悉
Microservices架構導致額外的架構設計、程式開發和監控維運管理的複雜度。
架構風格 - 單體式、微服務、事件驅動
Application Architecture Style
VM
VM
VM
VM
VM
VM
VM
VM
VM
Monolithic/Three-Tier Applications
Published API
Edge Gateway
Microservice A Microservice B Microservice C Microservice D
Microservices
API Service
API Service
Event-Driven Architecture
4+1架構視圖 - 說明靜態結構及動態行為
Architectural Blueprints - The “4+1” View Model of Software Architecture
by Philippe Kruchten(1995/11) IEEE Software 12 (6), pp. 42-50.
4+1架構視圖 - 說明靜態結構及動態行為
4+1 View Model of Software Architecture 視需要從大輪廓到細部設計
C4 Model: Context, Containers, Components, and Code
Diagramming software architecture using C4 model and C4-PlantUML
建議使用PlantUML,文字檔可入版控追蹤架構變更
@startuml
database "MySQL" as datastore {
[entity]
}
interface "REST API" as RA
interface "DAO API" as DA
interface "Batch API" as BA
[Angular] ..> RA : use
RA - [Service]
[Service] ..> DA : use
DA - [Spring Data JPA]
[Spring Data JPA] - BA
[Spring Data JPA] ..> [entity] : JDBC
[Batch Service] ..> BA : use
[Cron Job] ..> [Batch Service] : trigger
@enduml
開發工具技術框架 – Technology Stack & Version
Tier Client Client Client
Presentatio
n
Business Persistence Integration Data Source Analysis Security
Layer Mobile Web Desktop Reporting
Application
HTML5,
CSS3,
JavaScript
Java SE 8 Java SE 8
Framework
Angular 8 Spring Boot
REST API
Spring Boot
Spring
Security
JPA Apache
Camel
Infrastructure
Software
Nginx Tomcat 9 Tomcat 9 AWS
DynamoDB
Container AWS EKS AWS EKS AWS EKS
Operation System
AWS Linux
OS
AWS Linux
OS
AWS Linux
OS
AWS Linux
OS
Virtualization
AWS EC2 AWS EC2 AWS EC2 AWS EC2
Hardware x86 x86 x86 x86
Storage HD HD HD HD, SSD
Network HTTPS HTTPS HTTPS SFTP TLS 1.2
DevOps流程圖 - 每個階段採用工具或套件
DevOps Pipeline
Library &
Container
Source
Control
Dev Security
PPM
Auto
Build/Deploy
Quality
CI Runner
未來將使用
目前已使用