---
title: "什么是 Microservices？"
canonical: https://wavect.io/zh/glossary/microservices/
language: zh
description: "一种把应用拆分成许多个可独立部署的小服务的架构，它以真正的分布式系统复杂性为代价，换来扩展能力和团队独立性。"
image: "https://wavect.io/img/general/bak/open_graph_preview.jpg"
---

技术

# Microservices

一种把应用拆分成许多个可独立部署的小服务的架构，它以真正的分布式系统复杂性为代价，换来扩展能力和团队独立性。

最近审阅: 2026-06-02 审阅人 [Kevin Riedl](/zh/team/kevin-riedl/) [wiki ↗](https://www.wikidata.org/wiki/Q139796365)

微服务意味着把一个应用拆分成许多个小服务，每个服务负责业务的一块，且每个都能独立部署。你得到的不是一个所有东西都在同一进程中运行的程序，而是一支通过网络彼此通话的服务舰队。这个承诺是真实的：团队可以独立交付，你可以只扩展需要扩展的部分，而且一个服务可以故障却不拖垮整个系统。

代价同样真实，而且通常被低估。一旦你的函数调用变成跨网络的 [API](/zh/glossary/api/) 调用，你就有了一个分布式系统，而分布式系统很难。你继承了网络故障、延迟、分散在许多数据库中且没有简单事务的数据、服务之间的版本控制，以及运行、监控和调试许多活动部件而非一个的运维负担，这又抬高了对你 [CI/CD](/zh/glossary/ci-cd/) 成熟度的要求。一个过去只是一段堆栈跟踪的 bug，现在变成横跨五个服务和三个队列的追踪。

诚实的立场：大多数初创公司应该从单体（monolith）开始。一个结构良好的单一应用构建更快、调试容易得多，而且完全有能力把你带到真正的营收。当你有一个具体理由时再拆分成 [微服务](/zh/services/software-development/) ，比如团队大到一个代码库成为瓶颈，或一个工作负载确实需要独立扩展，而不是因为微服务是流行的答案。过早的微服务，是小团队把一个难题变成十个难题的方式。

Polity 运行在七个微服务上，这对它的规模和团队结构而言是正确的决定。这正是要点：架构应当跟随问题和组织架构图，而不是一场会议演讲。把边界画在它们确实能降低耦合的地方，并接受你画的每一条边界都是一次你现在必须捍卫的网络调用。

// FAQ

## 常见问题

### 什么是微服务？

一种把应用拆分成许多个可独立部署的小服务的架构，每个服务负责业务的一块，并通过网络与其他服务通话。它以分布式系统的复杂性为代价，换来独立部署和有针对性的扩展。

### 微服务与单体有何区别？

单体是一个进程中的一个应用，构建更快、调试容易得多。微服务是许多个联网的服务，更适合大团队和独立扩展，但运维难得多。大多数初创公司应该从单体开始，只在有具体理由时才拆分。

### 我们什么时候应该转向微服务？

当单一代码库已经成为团队的真正瓶颈时，或当一部分工作负载确实需要独立扩展时。不是因为它流行。过早的微服务会把一个难题变成十个，并拖慢一个小团队。

相关术语

- [SDLC](/zh/glossary/sdlc/)
- [CI/CD](/zh/glossary/ci-cd/)
- [API](/zh/glossary/api/)

相关服务

- [定制软件开发](/zh/services/software-development/)

相关案例研究

- [Polity](/zh/case-studies/polity/)

相关指南

- [如何为 MVP 选择技术栈](/zh/software-development-guide/how-to-choose-a-tech-stack-for-mvp/)

聊聊

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/#organization",
      "@type": [
        "Organization",
        "ProfessionalService",
        "LocalBusiness"
      ],
      "employee": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "founder": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "legalRepresentative": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "name": "Wavect GmbH",
      "subjectOf": {
        "@id": "https://wavect.io/verified-claims.json#dataset",
        "@type": "Dataset",
        "creator": {
          "@id": "https://wavect.io/#organization",
          "@type": [
            "Organization",
            "ProfessionalService",
            "LocalBusiness"
          ]
        },
        "description": "A machine-readable registry of quantitative and qualitative claims published by Wavect, with review dates, localized page appearances and public third-party citations where available.",
        "inLanguage": "en",
        "isAccessibleForFree": true,
        "license": "https://creativecommons.org/licenses/by/4.0/",
        "name": "Wavect verified publication claims",
        "url": "https://wavect.io/verified-claims.json"
      },
      "url": "https://wavect.io/"
    },
    {
      "@id": "https://wavect.io/team/kevin-riedl/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Kevin Riedl",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796365",
        "https://www.linkedin.com/in/wsdt",
        "https://github.com/wsdt"
      ],
      "url": "https://wavect.io/team/kevin-riedl/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/team/christof-jori/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Christof Jori",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796367",
        "https://www.linkedin.com/in/jocr77/",
        "https://github.com/jo-chris"
      ],
      "url": "https://wavect.io/team/christof-jori/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/#website",
      "@type": "WebSite",
      "inLanguage": [
        "en",
        "de",
        "es",
        "zh"
      ],
      "name": "Wavect",
      "potentialAction": {
        "@type": "SearchAction",
        "query-input": "required name=search_term_string",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://wavect.io/search/?q={search_term_string}"
        }
      },
      "publisher": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "url": "https://wavect.io/"
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/zh/glossary/microservices/#term",
      "@type": "DefinedTerm",
      "alternateName": [],
      "description": "一种把应用拆分成许多个可独立部署的小服务的架构，它以真正的分布式系统复杂性为代价，换来扩展能力和团队独立性。",
      "inDefinedTermSet": "https://wavect.io/zh/glossary/#termset",
      "name": "Microservices",
      "termCode": "microservices",
      "url": "https://wavect.io/zh/glossary/microservices/"
    },
    {
      "@id": "https://wavect.io/zh/glossary/microservices/#webpage",
      "@type": "WebPage",
      "about": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "author": {
        "@id": "https://wavect.io/team/kevin-riedl/#person",
        "@type": "Person",
        "name": "Kevin Riedl",
        "url": "https://wavect.io/team/kevin-riedl/"
      },
      "dateModified": "2026-06-02",
      "description": "一种把应用拆分成许多个可独立部署的小服务的架构，它以真正的分布式系统复杂性为代价，换来扩展能力和团队独立性。",
      "headline": "Microservices",
      "inLanguage": "zh",
      "isPartOf": {
        "@id": "https://wavect.io/#website",
        "@type": "WebSite"
      },
      "lastReviewed": "2026-06-02",
      "mainEntity": {
        "@id": "https://wavect.io/zh/glossary/microservices/#term"
      },
      "mentions": [
        {
          "@id": "https://wavect.io/#organization",
          "@type": [
            "Organization",
            "ProfessionalService",
            "LocalBusiness"
          ]
        },
        {
          "@type": "Service",
          "name": "定制软件开发",
          "url": "https://wavect.io/zh/services/software-development/"
        }
      ],
      "name": "Microservices",
      "reviewedBy": {
        "@id": "https://wavect.io/team/christof-jori/#person",
        "@type": "Person",
        "name": "Christof Jori",
        "url": "https://wavect.io/team/christof-jori/"
      },
      "speakable": {
        "@type": "SpeakableSpecification",
        "cssSelector": [
          ".gls-single__h1",
          ".gls-single__tldr"
        ]
      },
      "url": "https://wavect.io/zh/glossary/microservices/"
    },
    {
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "item": "https://wavect.io/zh/",
          "name": "首页",
          "position": 1
        },
        {
          "@type": "ListItem",
          "item": "https://wavect.io/zh/glossary/",
          "name": "技术、产品与合作模式术语表",
          "position": 2
        },
        {
          "@type": "ListItem",
          "item": "https://wavect.io/zh/glossary/microservices/",
          "name": "Microservices",
          "position": 3
        }
      ]
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "一种把应用拆分成许多个可独立部署的小服务的架构，每个服务负责业务的一块，并通过网络与其他服务通话。它以分布式系统的复杂性为代价，换来独立部署和有针对性的扩展。"
      },
      "name": "什么是微服务？"
    },
    {
      "@type": "Question",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "单体是一个进程中的一个应用，构建更快、调试容易得多。微服务是许多个联网的服务，更适合大团队和独立扩展，但运维难得多。大多数初创公司应该从单体开始，只在有具体理由时才拆分。"
      },
      "name": "微服务与单体有何区别？"
    },
    {
      "@type": "Question",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "当单一代码库已经成为团队的真正瓶颈时，或当一部分工作负载确实需要独立扩展时。不是因为它流行。过早的微服务会把一个难题变成十个，并拖慢一个小团队。"
      },
      "name": "我们什么时候应该转向微服务？"
    }
  ],
  "speakable": {
    "@type": "SpeakableSpecification",
    "cssSelector": [
      ".faq-question",
      ".faq-answer"
    ]
  }
}
```
