微服务概论(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 迁移至微服务
相关推荐
天空属于哈夫克312 小时前
企业微信二次开发:精准实现关键词自动回复
架构·企业微信
分布式存储与RustFS14 小时前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
晨米酱14 小时前
AGENTS.md:Agent 的上下文策略层
面试·架构·agent
这个DBA有点耶14 小时前
MVCC深入:Read View、版本链与快照读——InnoDB并发控制的内核
数据库·mysql·架构
codeejun15 小时前
每日一Go·MySQL-5、锁机制全解析
云原生·golang
码流子15 小时前
高速公路安全监测实践:碰撞监测预警+物联网底座,从感知到处置的闭环
大数据·人工智能·物联网·算法·架构
moMo16 小时前
从固定流程到问题路由:让 LangGraph RAG 按需检索
架构
张洛闻Eren16 小时前
k8s云原生【第十课】:水平 Pod 自动扩缩容
运维·数据库·云原生·kubernetes·github
白远山17 小时前
上海24小时自助健身房解决方案实战指南与经验分享
java·数据库·架构·需求分析
LorryJovens17 小时前
【LAAP科研】双系统具身AGI范式研究——基于LAAP认知架构与Jev概率决策模型的系统性技术调研与范式验证
人工智能·gpt·安全·架构