The Cancer pattern has a word we do not have a favorable view of. However, this pattern is becoming needed in more and more environments. This pattern is one for conversions and migrations. We do not always have a clean slate for our architecture. Thus, we need designs to handle the modification of an existing architecture.
The Cancer Pattern DefinedThe way Cancer evolves is that it replaces cells with something new while leaving things functional. This approach is how we often want to replace a system in place. We cannot shut things down and might not be able to do a swap. The cancer pattern is a sort of "hot swap" of a system with a new solution. We do not address the entire thing at once. Instead, we selectively update, upgrade, or replace pieces at a time. As time goes on, we can entirely replace the system. Sometimes without end-users being any the wiser.
Applying The PatternThe key to this pattern is to isolate the pieces of the original architecture. We want to avoid making more changes than needed. Likewise, we do not want to de-stabilize the current system. Think of a Jenga game where instead of removing blocks from the stack, you are replacing them. When we replace a piece of the system, we want to make sure we do it in a way that mirrors existing integrations wherever possible. You can review the microkernel pattern for another way that components are viewed as a plug-and-play approach to functionality.
Challenges Stability is the issue with this pattern. When too much change is tackled in a batch, it can bring down the whole system. There will also be integration details that can keep a component from being cleanly replaced. Those situations can require some thinking layers or kludges to hold things together until we can craft a better replacement. This pattern is also a time-consuming and complex one to implement. You are not working from scratch. Therefore, the original system needs to be understood in detail. Then those details are used to map to the new solution.