微服务概论(https://microservices.io/)

What are microservices?

Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of two or more services that are:

Independently deployable

Loosely coupled

Services are typically organized around business capabilities. Each service is often owned by a single, small team.

微服务只是一种架构风格,它把单体服务拆分成子服务,子服务的特点:

  • 独立开发和部署
  • 松耦合
  • 按照业务能力拆分(DDD)
  • 自治的团队

微服务架构是典型的分治思想。通过对服务的拆分来管理复杂度。避免单体服务的膨胀。

Microservices enable fast flow

微服务通过自治的团队和自动化devops(CI/CD)来实现快速的更新和部署。要实现微服务必须要有对应的组织架构调整(自治的小团队)和基础设施条件。

Design microservices using Assemblage

The key challenge when using microservices is designing a good service architecture.

If you get it wrong you risk creating a distributed monolith, which will slow down software delivery.

Assemblage is an architecture definition process for grouping subdomains/bounded contexts into services.

需要有一套方法来拆分微服务,不然做不到高内聚低耦合,尤其是服务之间以来太强,变成了一个分布式的单体服务

Dark energy and dark matter shape the architecture

Assemblage uses the dark energy and dark matter forces to shape the service architecture.

Dark energy forces encourage decomposition into smaller services. Dark matter forces resist decomposition.

The balance between these forces shapes the service architecture.

基本就是高内聚低耦合的思想。同一领域的业务逻辑应该在一个服务内。subdomain之间的依赖关系最好是单向的。

The pattern language is your guide

The microservices pattern language is your guide when designing an architecture: service collaboration, testing, deployment, common crosscutting concerns and more. It's a collection of patterns that help you make decisions when designing and evolving an architecture.

微服务专业术语使沟通更为便捷

Incrementally refactor a monolith to microservices

The monolithic architecture is not an anti-pattern. It's a good choice for small teams and small projects.

But if you outgrow your monolithic architecture, you need to refactor it to services using the Strangler Fig pattern.

由单体服务过渡到微服务,最重要的是平滑过度。

  • 剥离核心功能
  • 微服务实现核心功能
  • data & api 迁移至微服务
相关推荐
Dawson Zhu11 小时前
《Agentic Design Patterns》第 1 章导读:提示词链(Prompt Chaining)
人工智能·语言模型·架构·aigc·agi
feiyu_gao12 小时前
Mindcraft:从个人实践到可复用模式集
架构·aigc·ai编程
abigalexy12 小时前
Claude Code从零搭建新项目全流程AI实现-宠物生命周期管理App
架构·aigc·ai编程
寻林写彡12 小时前
云安全 | Docker 容器逃逸复盘(一):从隔离边界到运行时链路,如何确认自己身处容器
安全·云原生
写后端的胖头鱼13 小时前
【高频面试题】微服务项目排查错误流程(万字详解)
微服务·架构·问题定位·链路·线上排错
小小龙学IT13 小时前
Kubernetes 深度实践:架构、API 与避坑指南
容器·架构·kubernetes
MayBaymax14 小时前
MQ 基础概念与架构
java·中间件·架构·java-rocketmq
嘎嘎风14 小时前
MiniMind 学习笔记之 04 注意力之外:位置、记忆、省显存、省时间、深加工
架构·源码阅读
国科安芯15 小时前
商业立方星平台中高集成度抗辐射MCU的功耗优化与批量化应用可行性探讨
单片机·嵌入式硬件·架构·risc-v·抗辐射·as32x601
ESDWAN17 小时前
企业跨境网络合规建设指南:从线路选择到数据出境的全流程方案
网络·架构