Course contentsShow
← Software Engineering
Lesson 1775 of 1,93351. Legacy Code and Brownfield DevelopmentFree lesson

Identifying Strangulation Boundaries

How to analyze legacy systems and choose appropriate boundaries for incremental replacement and migration.

Identifying Strangulation Boundaries

You'll learn how to analyze a legacy system and find the right seams where new code can gradually replace old, using the Strangler Fig Pattern strategically.

What Is a Strangulation Boundary?

A strangulation boundary is the dividing line between old and new code where you'll intercept requests and route them to either the legacy system or your modern replacement. Think of it like finding the right place to tap into a water pipe—you want a spot where you can divert flow cleanly without causing leaks or breaking everything downstream.

The challenge isn't just technical; it's strategic. Choose poorly, and you'll spend months untangling dependencies. Choose well, and your migration becomes a series of manageable, value-delivering steps.

How to Identify Good Boundaries

Look for natural seams you discovered earlier in your legacy exploration:

  • Bounded contexts: Where business concepts naturally separate (e.g., "Orders" vs "Inventory")
  • API or service boundaries: Existing interfaces where calls enter/exit components
  • Data ownership lines: Where different parts of the system manage distinct data models
  • User-facing features: Complete workflows that users recognize as distinct capabilities

Prioritize by value and risk:

  • Start with high-value, low-risk boundaries where success builds momentum
  • Avoid deeply entangled areas until you've gained experience
  • Consider boundaries with clear inputs/outputs where you can write characterization tests easily

Validate your boundary:

  • Can you intercept traffic at this point without major surgery?
  • Can you implement a thin abstraction layer here?
  • Will business stakeholders recognize incremental value?
  • Can you safely route some requests to new code while others hit old code?

Key Takeaway: The best strangulation boundaries are natural seams with clear interfaces, minimal entanglement, and business value that justifies the migration effort—choose boundaries where you can safely intercept, route, and incrementally replace functionality.