微服务概论(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 迁移至微服务
相关推荐
RInk7oBjo4 分钟前
从零设计生产级 Multi-Agent Harness:架构、评估、记忆、成本与 MCP 工具接入全拆解
架构
张伯毅1 小时前
如何构建一个生产级 AI Agent CLI —— 以 Claude Code 架构探索
人工智能·架构
covco2 小时前
分布式架构实战:全平台矩阵管理系统的技术实现与性能优化
分布式·矩阵·架构
ILL11IIL3 小时前
k8s的pod管理及优化
云原生·容器·kubernetes
dhashdoia3 小时前
GPT-5.5 代码开发实战:Codex与Browser Use深度集成与星链4SAPI优化方案
java·数据库·人工智能·gpt·架构
AiTop1004 小时前
商汤发布SenseNova 6.7 Flash-Lite:原生多模态架构打破“视觉转文本“瓶颈,Token消耗直降 60%
人工智能·ai·架构
倔强的胖蚂蚁4 小时前
主流大模型使用指南:Gemma/Llama 全流程
云原生·llama
不懂的浪漫4 小时前
02|Netty 服务端是怎么启动的:从 ServerBootstrap.bind() 看源码主线
架构·netty
小白编程锤炼5 小时前
深入解析:质量门禁
人工智能·算法·架构·vibe-coding
申耀的科技观察6 小时前
【观察】戴尔科技:从“架构解耦”到“智能融合”,DAP驱动现代化数据中心“再进化”
科技·架构