# 绞杀榕模式（五）陷阱与不适合的情况

> 最常见的陷阱是要求新系统和旧系统一模一样；其次是鹰架拆不掉、只换技术不换做事方式、看不见的下游、节奏太慢。系统小或切不开时，这个模式可能不适合。

发布 2026-11-09・更新 2026-11-09・网址 https://wizerdbache.com/zh-hans/notes/strangler-fig-pitfalls/


这是系列第五篇。前面讲的是怎么做；这一篇整理各篇提醒的出事点，以及这个模式可能不适合的情况。

## 先讲结论

- **「新系统要和旧系统一模一样」是我读到的范围里最常出现的警告**；Thoughtworks 的作者整体不建议这样做（Cartwright et al., 2021）。
- **鹰架拆不掉**：收缩那一步没做，结果可能比起点更糟（Sato, 2014）。
- **只换技术不够**：技术顶多占遗留系统问题的一半（Cartwright et al., 2024b）。
- **看不见的下游与隐藏功能**，可能在上线测试后才冒出来（Cartwright et al., 2024b；Hammant, 2013）。
- **节奏太慢**：Hammant 认为项目很可能被出资者取消（Hammant, 2013）。

## 一、「新系统要和旧系统一模一样」

Cartwright 等人专门写了一篇谈功能对等 (Feature Parity)，整体立场是一般不建议，并说 Thoughtworks 曾在技术雷达上把它列为暂缓 (hold)（[Cartwright et al., 2021, “When to use it”](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html#when)）。理由包括：

- 「凡有疑问就照现行行为做」，前提是你完全理解现行行为，而且能验证新系统做了同样的事（[Cartwright et al., 2021](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html)）。
- 多数遗留系统随时间膨胀，许多功能其实没人用。文中引用 2014 年 Standish Group 的报告，标出 50%，但没有说明这个比例的分母（[Cartwright et al., 2021](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html)）。
- 为了绕过旧系统缺陷而发展出的变通做法，已经变成业务流程的必要环节，会被当成需求原样重做（[Cartwright et al., 2021](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html)）。
- 盘点现况的工作越做范围越大、看不到终点，最后只好走捷径；被砍掉的有本来就该砍的功能，通常也有关键功能（[Cartwright et al., 2021, “When to use it”](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html#when)）。

Fowler 2004 年的文章也说，重写总是比表面上复杂，旧功能得保留，连旧缺陷也常要一并加回来（[Fowler, 2004](https://martinfowler.com/bliki/OriginalStranglerFigApplication.html)）。Cartwright 等人的总览文则把功能对等列为一个组织数次汰换失败的关键因素之一：光是定义并同意「现在有哪些功能」就是巨大的工作，最后导向单一的大爆炸式切换（[Cartwright et al., 2024b, “The legacy replacement treadmill”](https://martinfowler.com/articles/patterns-legacy-displacement/#TheLegacyReplacementTreadmill)）。

**替代做法。** Feature Parity 一文提出的，包括沿产品线或价值流切出薄片、用使用数据缩小范围、直接观察用户。文中有一个案例，团队只跟着现有员工观察了几天，就看出功能对等不适用（[Cartwright et al., 2021, “Alternative approaches”](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html#AlternativeApproaches)）。

**例外。** 作者也列出两种他们见过、功能对等有道理的情况：专家使用、高度优化的界面，以及行为由广为人知的规格决定的系统。他们称这些是例外。

## 二、鹰架拆不掉

过渡组件的生命周期包含拆除。Cartwright 等人说，建造时可能值得为日后拆除多投入一点，并要确认它真的被拆掉（[Cartwright et al., 2022, “How it works”](https://martinfowler.com/articles/patterns-legacy-displacement/transitional-architecture.html#how)）。Sato 对平行变更的警告也是同一件事：收缩那一步没做，结果可能比起点更糟（[Sato, 2014](https://martinfowler.com/bliki/ParallelChange.html)）。Microsoft 提醒外观层得跟上迁移进度；Microsoft 与 AWS 都提醒它不能变成单点故障或性能瓶颈（[Microsoft, n.d.-b, “Problems and considerations”](https://learn.microsoft.com/en-us/azure/architecture/patterns/strangler-fig#problems-and-considerations)；[Amazon Web Services, n.d., “Issues”](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html#strangler-fig-issues)）。

我的看法是，「搬到一半，永远两套系统」是这个模式最典型的失败形态。它不会像大爆炸切换那样在某一天爆开，而是悄悄把系统变得比原来更复杂。至于有多少比例的迁移项目停在半途，我没找到可靠出处，所以不引用任何这类数字。

## 三、只换技术，不换做事的方式

Fowler 说，系统之所以僵硬脆弱，是产生它们的设计思维与组织流程造成的；组织文化与领导不变，新系统也会落入类似的混乱（[Fowler, 2024](https://martinfowler.com/bliki/StranglerFigApplication.html)）。Cartwright 等人根据他们的观察，认为技术顶多占遗留系统问题的一半，工作方式、组织结构与领导同样关键（[Cartwright et al., 2024b, “The legacy replacement treadmill”](https://martinfowler.com/articles/patterns-legacy-displacement/#TheLegacyReplacementTreadmill)）。

他们也举了一个电信业的案例：旧的变更控制流程被原样套在新做法上，团队花在填变更表单、开审查会议的时间多过写软件，新做法最后被组织排了出去（[Cartwright et al., 2024b, “Change the organization”](https://martinfowler.com/articles/patterns-legacy-displacement/#ChangeTheOrganizationToAllowThisToHappenOnAnOngoingBasis)）。

## 四、看不见的下游与隐藏功能

Cartwright 等人总览文的案例里，被替换组件的数据库经由复写与批量作业流向业务关键报表，团队是在新实作上线测试后，追查报表数字对不上才发现这条路径（[Cartwright et al., 2024b, “An example: integration middleware removal”](https://martinfowler.com/articles/patterns-legacy-displacement/#AnExampleIntegrationMiddlewareRemoval)）。Hammant 也提醒，旧系统可能藏着被遗忘的功能，连逆向分析都可能漏掉，而且任何重写都有这个风险（[Hammant, 2013, “Best practices”](https://paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/#best-practices)）。

## 五、节奏太慢，出资者先放弃

Hammant 提出一个具体节奏：开工约一个月内第一次上线，之后至少每两周一次，否则项目会失败；他认为很可能是出资者取消项目。他还主张把汰换和看得见的新功能交织在一起，让每次发布对出资者都有价值（[Hammant, 2013, “Best practices”](https://paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/#best-practices)）。他也指出，逐次发布让计划可以在任何一次发布后暂停、重新排序，大爆炸式的计划遇到重大暂停则只能认列损失（[Hammant, 2013](https://paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/)）。要注意的是，他自己列的几个案例，节奏有的比这个建议疏、有的比它密。

Fowler 2004 年的文章提到同事 Chris Stevenson 的项目：还没走到旧系统被取代那一步，但已交付的功能让团队得到继续推进的信用；Fowler 说即使项目现在停下，投资报酬也高于许多一次切换的重写（[Fowler, 2004](https://martinfowler.com/bliki/OriginalStranglerFigApplication.html)）。这是单一个案的转述，没有附数字。

## 六、可能不适合的情况

各篇写出的、这个模式可能不适合的情况（原文多半用「可能」，不是禁令）：

- **系统小、整套替换很简单**（[Microsoft, n.d.-b, “When to use this pattern”](https://learn.microsoft.com/en-us/azure/architecture/patterns/strangler-fig#when-to-use-this-pattern)；[Amazon Web Services, n.d.](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html)）。
- **请求拦截不到**（Microsoft, n.d.-b）。
- **拿不到旧系统的源代码，也没有其他可更动的集成点**（Microsoft, n.d.-b）。
- **需要很快、完全地把旧系统下线**（Microsoft, n.d.-b）。反过来说，旧系统能在迁移期间长期并存，是 Microsoft 列出的适用情境之一。
- **业务领域还不清楚。** AWS 提醒，过早拆分可能代价很高，边界也可能画错；建议先用领域建模找出候选边界（[Amazon Web Services, n.d., “Issues”](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html#strangler-fig-issues)）。

另外值得一提的是 Hammant 的超市案例：新旧技术差距很大，前面没有代理层，靠的是训练用户跨过落差。Hammant 把它当成仍在进行的绞杀案例，不是不适用的例子（[Hammant, 2013, “National supermarket's internal planning app”](https://paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/#national-supermarkets-internal-planning-app)）。我的看法是，它说明找不到技术接缝时，共存可以退到人的层次。

我的整理是，这些条件归结起来在问两件事：有没有地方可以切（接缝），以及新旧并存的成本值不值得付（过渡成本）。两个答案都是「没有」或「不值得」时，直接替换可能是比较老实的选择。

## 这个系列

1. [为什么不整个重写，绞杀榕模式又是什么](https://wizerdbache.com/zh-hans/notes/strangler-fig-overview/)
2. [接缝：从哪里切开旧系统](https://wizerdbache.com/zh-hans/notes/strangler-fig-seams/)
3. [新旧共存：防腐层、过渡架构、抽象分支、平行变更](https://wizerdbache.com/zh-hans/notes/strangler-fig-coexistence/)
4. [切换与验证：把不能回头的那一步留到最后](https://wizerdbache.com/zh-hans/notes/strangler-fig-cutover/)
5. 陷阱与不适合的情况（本篇）
6. [学术界怎么看：证据、缺口与一份检查清单](https://wizerdbache.com/zh-hans/notes/strangler-fig-evidence/)

## 来源

- [Cartwright, I., Horn, R., & Lewis, J. (2021, July 27). Feature parity. martinfowler.com.](https://martinfowler.com/articles/patterns-legacy-displacement/feature-parity.html)（模式文章）
- [Cartwright, I., Horn, R., & Lewis, J. (2022, March 28). Transitional architecture. martinfowler.com.](https://martinfowler.com/articles/patterns-legacy-displacement/transitional-architecture.html)（模式文章）
- [Cartwright, I., Horn, R., & Lewis, J. (2024b, March 5). Patterns of legacy displacement. martinfowler.com.](https://martinfowler.com/articles/patterns-legacy-displacement/)（模式集总览）
- [Fowler, M. (2004, June 29). Original strangler fig application (Rev. 2019, April 29). martinfowler.com.](https://martinfowler.com/bliki/OriginalStranglerFigApplication.html)（博客文章）
- [Fowler, M. (2024, August 22). Strangler fig. martinfowler.com.](https://martinfowler.com/bliki/StranglerFigApplication.html)（博客文章）
- [Sato, D. (2014, May 13). Parallel change. martinfowler.com.](https://martinfowler.com/bliki/ParallelChange.html)（博客文章）
- [Hammant, P. (2013, July 14). Legacy application strangulation: Case studies. Paul Hammant's blog.](https://paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/)（案例集）
- [Microsoft. (n.d.-b). Strangler Fig pattern. Azure Architecture Center. Retrieved November 8, 2026.](https://learn.microsoft.com/en-us/azure/architecture/patterns/strangler-fig)（官方文档）
- [Amazon Web Services. (n.d.). Strangler fig pattern. AWS Prescriptive Guidance. Retrieved November 8, 2026.](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html)（官方文档）
