Design Pattern
- Layered architecture
- Event-driven architecture
- Microkernel architecture (or Plugin architecture)
- Microservices architecture
- Space-based architecture (or Cloud architecture pattern)
Layered architecture
最常使用在 monolithic 應用程式的架構,基本的概念是將應用程式的邏輯拆分成各個有各自角色的層級。例如 Persistence layer,將會負責應用程式和資料庫之間的溝通
Event-driven architecture
此模式的概念是將應用程式邏輯解耦成非同步接收和處理事件的單一用途的事件處理元件。
Microkernel Architecture
此模式的設計方式是拆分兩個主要的元件:核心系統和套件模組。舉例來說就像是瀏覽器和相關的 extensions。
Microservices Architecture
現行最流行的設計模式,全部的系統由數個服務所組成,其每個服務都只負責一件事情。每個服務之間都各自獨立
Space-Based Architecture
其主要概念是以分散式系統之下,共享記憶體。
微服務系統設計 Best Practices
- Single Responsibility Principle
- Have a separate data store(s) for your microservice
- Use asynchronous communication to achieve loose coupling
- Fail fast by using a circuit breaker to achieve fault tolerance
- Proxy your microservice requests through an API Gateway
- Ensure your API changes are backwards compatible
- Version your microservices for breaking changes
- Have dedicated infrastructure hosting your microservice
- Create a separate release train
- Create Organizational Efficiencies