Overview
The strangler fig pattern, as described by Martin Fowler, works by incrementally replacing functionality in a legacy system while keeping the legacy system alive and authoritative until each replaced piece has been validated. The key word is incrementally: the pattern only delivers its safety guarantees if each increment is small enough to roll back quickly and independently of every other increment. For CICS core banking, an increment is typically one transaction type — say, balance enquiry (BLEN), standing order setup (SORD), or FX rate lookup (FXRT) — not an entire functional domain.
The routing layer is the mechanism that makes incrementalism possible. Without a routing layer, the team is choosing between two states: all traffic on CICS, or all traffic on the new service. With a routing layer, the team has a continuous dial: 0% new, 1% new, 5%, 20%, 50%, 100%. The dial can be turned in either direction at runtime without a deployment. This ability to roll back in under 30 seconds — without a code push, without an MQ drain, without a DBA action — is what separates a managed modernisation from a production incident waiting to happen.
IBM ACE is the natural choice for the routing layer in an IBM-stack bank. ACE integrates natively with CICS via the CICS Request Node (HTTP or MQ-based), supports runtime-configurable flow routing via configurable services and user-defined properties, and already sits in the trust boundary between channel-layer APIs and the core banking tier. The routing proxy is an ACE flow, not a new piece of infrastructure, and it can be deployed alongside the existing integration estate with no new network paths.
The strangler fig pattern is not the only approach to core banking decomposition. Big-bang cutover (new system go-live on a date certain, legacy retired immediately) minimises the dual-run period but maximises the blast radius of a failure. Rewrite-in-place (evolving the legacy system internally while keeping its external interface) avoids routing complexity but is constrained by whatever the legacy platform can express. The strangler fig sits between these: a longer dual-run period in exchange for per-transaction rollback granularity and no dependency on the legacy platform’s extensibility. For CICS in a regulated bank, the dual-run cost is almost always worth it.
Routing Layer Design
The routing layer has four responsibilities: receive the inbound request from the channel API, determine which backend should handle it (CICS or new service), route the request accordingly, and return a response that is semantically identical regardless of which backend handled it. The fourth responsibility is the hard one: if the new service returns a different field name, a different error code, or a different HTTP status for the same logical outcome, the routing layer must translate it before the channel API sees it. This is not a performance-neutral operation — it adds latency — but it is essential for the channel API to be unaware of which backend is currently active for each transaction type.
Three routing modes are worth distinguishing. Canary mode: N% of requests go to the new service and (100−N)% to CICS; both paths handle real traffic; the routing decision is sticky per request (not per session). Shadow mode: 100% of requests go to CICS for authoritative response; the routing layer also sends a copy of each request to the new service and records whether the responses match, without the new service’s response ever reaching the caller. Shadow mode is the validation phase before any real traffic shifts. Full cutover: 100% to the new service; CICS path remains in the routing layer but receives zero traffic; can be restored in seconds by flipping the flag.
ACE Proxy Flow
The routing proxy is a single ACE message flow per transaction type (or one parameterised flow with transaction-type input from the HTTP path). The flow structure is: HTTP input node → ESQL compute node (feature flag evaluation and traffic split decision) → Route node with two output terminals → CICS Request node (output terminal 1) or HTTP Request node to new service (output terminal 2) → ESQL compute node (response normalisation) → HTTP Reply node.
CREATE COMPUTE MODULE StranglerFig_EvaluateRoute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- Read the transaction type from the HTTP path
DECLARE txType CHARACTER SUBSTRING(
InputLocalEnvironment.HTTP.Input.Path FROM
POSITION('/transactions/') + 14
);
-- Read the per-transaction-type routing weight from
-- the ACE configurable service (backed by a ConfigMap)
DECLARE newSvcWeight INTEGER
CAST(ConfigurableService.'StranglerFig'.newSvcWeight_{txType}
AS INTEGER);
IF newSvcWeight IS NULL THEN
SET newSvcWeight = 0; -- default: all traffic to CICS
END IF;
-- Shadow mode flag: respond from CICS, copy to new svc
DECLARE shadowMode BOOLEAN
CAST(ConfigurableService.'StranglerFig'.shadowMode_{txType}
AS BOOLEAN);
-- Pseudo-random split: use a hash of the correlation ID
-- so the same request always routes to the same backend
-- within a single transaction (idempotency protection)
DECLARE corrId CHARACTER
InputRoot.HTTPInputHeader."X-Correlation-ID";
DECLARE bucket INTEGER
MOD(BITXOR(CRC32(CAST(corrId AS BLOB CCSID 1208)), 0), 100);
SET OutputLocalEnvironment.Routing.shadowMode = shadowMode;
SET OutputLocalEnvironment.Routing.txType = txType;
SET OutputLocalEnvironment.Routing.corrId = corrId;
IF shadowMode THEN
-- Always route to CICS; shadow copy handled downstream
SET OutputLocalEnvironment.Routing.destination = 'CICS';
ELSEIF bucket < newSvcWeight THEN
SET OutputLocalEnvironment.Routing.destination = 'NEWSVC';
ELSE
SET OutputLocalEnvironment.Routing.destination = 'CICS';
END IF;
PROPAGATE TO TERMINAL 'out';
RETURN FALSE;
END;
END MODULE;
The correlation-ID hash ensures that a client which retries a failed request is routed to the same backend as the original attempt. Without sticky routing, a timeout on the new service might cause the retry to land on CICS — which could then succeed — and the client and the system would have different views of what happened. This is especially important for balance-modifying operations (debit, credit, standing-order setup) where idempotency across the routing boundary is a correctness requirement, not just a performance preference.
The canary split is safe for read operations (balance enquiry, rate lookup, limit check) where the new service and CICS can produce divergent results without either mutating state. For write operations (payment initiation, standing-order setup, account update), use shadow mode until the new service has been validated against CICS for at least 30 days with zero divergence. Only then flip the canary weight for mutations, starting at 1% with an on-call team watching the divergence dashboard in real time.
Feature-Flag Cutover
The routing weights are stored as an OpenShift ConfigMap, which ACE reads via a configurable service. The ConfigMap contains one entry per transaction type per routing dimension: the canary weight, the shadow flag, and the emergency-fallback flag (which forces 100% CICS regardless of other settings). A Kubernetes admission webhook validates the ConfigMap before it is applied, rejecting any update that would increase the canary weight by more than 10 percentage points in a single step or that would flip the shadow flag and the canary weight simultaneously.
apiVersion: v1
kind: ConfigMap
metadata:
name: strangler-fig-routing
namespace: integration
annotations:
# Triggers ACE configurable service refresh on apply
ace.ibm.com/configurable-service-refresh: "StranglerFig"
data:
## Balance Enquiry (BLEN) — read-only, shadow validated
newSvcWeight_BLEN: "20" # 20% canary — step from 10% last week
shadowMode_BLEN: "false" # shadow complete, canary active
fallback_BLEN: "false"
## FX Rate Lookup (FXRT) — read-only, shadow in progress
newSvcWeight_FXRT: "0"
shadowMode_FXRT: "true" # validating response parity
fallback_FXRT: "false"
## Standing Order Setup (SORD) — write, not yet in shadow
newSvcWeight_SORD: "0"
shadowMode_SORD: "false"
fallback_SORD: "false"
## Emergency master fallback — overrides all weights
emergencyFallback: "false" # set to "true" to 100% CICS all tx-types
The ConfigMap is managed in Git and applied via ArgoCD with manual sync gate for any change that increases a canary weight above 10% or enables canary for a write transaction type for the first time. The admission webhook is the technical control; the manual sync gate is the governance control. Both are required: the webhook catches mistakes in automated pipelines, and the manual gate ensures a human reviews the change before it affects live traffic.
Canary and Shadowing
Shadow mode deserves its own discussion because it is the most valuable phase of the strangler fig and the one most commonly skipped. In shadow mode, every request is answered by CICS — the caller never sees the new service response — but the routing layer also fires-and-forgets the same request to the new service, compares the two responses in an async ESQL compute node, and publishes a divergence event to Kafka if they differ. The shadow log is the most direct evidence that the new service is correct before any real traffic depends on it.
Divergences in shadow mode are not failures: they are findings. The shadow log is a backlog of correctness issues to resolve before canary traffic begins. In practice, the first shadow run will surface field-name differences, missing fields, timestamp format disagreements, and rounding differences in monetary amounts. Each finding is logged with the full request and both responses so the team can reproduce it without digging through production logs. Shadow mode should run for a minimum of two weeks, covering a full weekly cycle of transaction patterns, before canary begins for read operations.
CREATE COMPUTE MODULE StranglerFig_ShadowCompare
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE txType CHARACTER InputLocalEnvironment.Routing.txType;
DECLARE corrId CHARACTER InputLocalEnvironment.Routing.corrId;
-- Canonical response from CICS (already returned to caller)
DECLARE cicResp REFERENCE TO InputRoot.DFDL;
-- Call new service with the same request (fire-and-forget)
DECLARE newSvcResponse ROW;
CALL InvokeNewService(txType, corrId, newSvcResponse);
-- Compare on the canonical fields only (amount, accountId, status)
DECLARE diverged BOOLEAN FALSE;
IF cicResp.Amount <> newSvcResponse.amount THEN
SET diverged = TRUE;
END IF;
IF cicResp.AccountId <> newSvcResponse.accountId THEN
SET diverged = TRUE;
END IF;
IF diverged THEN
-- Publish divergence event to Kafka for analysis
SET OutputRoot.JSON.Data.type = 'SHADOW_DIVERGENCE';
SET OutputRoot.JSON.Data.txType = txType;
SET OutputRoot.JSON.Data.correlationId = corrId;
SET OutputRoot.JSON.Data.cicsResponse = cicResp;
SET OutputRoot.JSON.Data.newSvcResponse = newSvcResponse;
SET OutputRoot.JSON.Data.timestampUtc = CURRENT_TIMESTAMP;
PROPAGATE TO TERMINAL 'kafka_divergence_out';
END IF;
RETURN FALSE; -- caller already has the CICS response
END;
END MODULE;
CICS Transaction Mapping
The routing layer needs to understand the CICS transaction boundary to route correctly. Each CICS transaction has a 4-character transaction ID (BLEN, SORD, FXRT), a fixed-length COMMAREA layout, and a synchronous request-reply semantics via CICS Link or via MQ trigger. The routing proxy maps each inbound REST endpoint to exactly one CICS transaction type. The COMMAREA layout is documented in the CICS service catalogue; the proxy uses ACE DFDL models to parse COMMAREA responses into the internal JSON tree before normalisation.
Three CICS interface patterns appear in Saudi banking estates: direct CICS Web Services (SOAP/HTTP via CICS WS bridge), MQ-triggered CICS transactions (MQ trigger monitor starts the CICS task when a message arrives on the trigger queue), and ECI-over-MQ (External CICS Interface calls from ACE via the CICS ECI Resource Adapter). The routing proxy handles all three; the most common in production is MQ-triggered because it was the pattern adopted in the mid-2000s when ACE (then WebSphere Message Broker) was first deployed. The proxy's CICS Request node is configured for MQ transport in this case, using the trigger queue name that matches the transaction ID.
CICS transactions in a Saudi bank typically complete in 50–200 ms end-to-end via MQ transport. The routing layer adds 5–15 ms for ESQL evaluation and response normalisation. Shadow mode adds another 50–200 ms for the async new-service call — but this is off the critical path (fire-and-forget), so it does not add to the response latency seen by the caller. When the shadow call runs longer than 5 seconds, it is abandoned and a timeout event is published to Kafka. Do not let shadow-mode failures block CICS responses.
Rollback Gates
A rollback gate is a pre-defined condition that triggers an automatic reduction in canary traffic, with an alert to the on-call team, without requiring a human to notice the problem first. The gate monitors three signals: error rate on the new service (HTTP 5xx/timeouts per transaction type), divergence rate from the shadow log (percentage of requests where CICS and new service responses differ), and latency differential (p99 latency of new service minus p99 latency of CICS, alerting if the differential exceeds 300 ms).
The rollback itself is a single ConfigMap patch. The gate controller — a small Go operator running in the integration namespace — watches the Prometheus metrics and patches the ConfigMap if any gate threshold is breached, reducing the affected transaction type’s canary weight to zero. The patch propagates to the ACE configurable service refresh annotation and ACE picks it up within 2–5 seconds. The mean time to rollback is under 10 seconds from gate trigger to full CICS traffic, which is within any reasonable SLA budget.
The emergencyFallback: "true" flag routes 100% of all transaction types to CICS regardless of individual canary weights. This is the fire alarm, not the fire exit: it should be used only when the routing layer itself is behaving unexpectedly and you want to guarantee CICS is the only backend until the team has investigated. Test it explicitly: apply the flag in staging under a representative load, confirm that ACE picks it up within 5 seconds and that the canary weight overrides are ignored, and document the rollback procedure in the runbook. A fire alarm that hasn’t been tested is a sticker on the wall.
Observability
The routing layer emits four categories of metric to Prometheus: routing decision counters (how many requests were sent to each backend per transaction type per time window), response time histograms for CICS and the new service independently (enabling p50/p95/p99 comparison), shadow divergence counters (total divergences, divergences by field, divergences by transaction type), and rollback event counters (how many times each gate triggered per transaction type). These four categories are the minimum viable observability set for a live strangler fig migration. Without them, the team is operating blind.
The Grafana dashboard for the strangler fig migration has one panel per transaction type in migration, showing the routing split as a stacked bar over time (blue for CICS, green for new service), the divergence rate as a line, and the rollback event markers as vertical annotations. The dashboard is the shared truth for the VP, the engineering team, and the risk and compliance review: anyone can see the current state of the migration without opening a ticket or attending a meeting.
Production Checklist
-
Build and validate the shadow mode for all target transaction types
Deploy the routing layer with all canary weights at 0 and all shadow flags at
true. Run for a minimum of two full weekly cycles. Resolve every divergence in the shadow log before proceeding. Divergence rate must reach zero for 7 consecutive days per transaction type before that type is cleared for canary. -
Disable shadow mode and start canary at 1% for read-only transaction types
Read-only transaction types (balance enquiry, rate lookup, limit check) go first. 1% canary for 48 hours. No divergences in Prometheus (the new service is now handling real traffic). Confirm the rollback gate controller fires correctly by temporarily injecting errors into the new service in a staging environment that mirrors the production routing layer.
-
Step the canary weight in 10-point increments, with 48-hour holds
Apply each weight increase as a manual-sync ArgoCD deployment. Wait 48 hours at each step. If the rollback gate fires at any step, hold at the previous weight until the root cause is identified and fixed. Never skip a step because the previous step looked clean.
-
At 100% read-only canary, begin shadow mode for write transaction types
Proving that the new service handles reads correctly is a prerequisite for starting shadow validation of writes — not because they are technically coupled, but because a team that is managing a canary migration for reads while starting shadow validation for writes is managing two concurrent risk surfaces. Serialise them.
-
Validate write shadow mode: apply idempotency checks, not just field comparison
Shadow mode for writes compares the logical outcome (account state after the operation) not the HTTP response. The shadow call must be idempotent-safe: use a shadow-specific idempotency key suffix (
shadow-<corrId>) to prevent the new service from treating shadow calls as real state changes. If the new service does not support idempotency keys, shadow mode for writes is not safe and must wait until it does. -
Begin canary for write transaction types at 1%, on-call during business hours only
Write canary requires on-call coverage during the initial window. First 1% canary for write operations should be active only during business hours (08:00–17:00 AST, Sunday–Thursday), with the emergency fallback flag in the runbook and an on-call engineer watching the divergence dashboard for the full window. Outside business hours, the emergency fallback returns to CICS until the team is confident enough to extend the window.
-
Retire the CICS path after 60 consecutive business days of zero CICS traffic
Once a transaction type reaches 100% new service, leave the CICS path in the routing layer with the weight at zero for 60 business days. This is the decommission gate. If no incident has required a rollback in that window, the CICS Request node for that transaction type may be removed from the ACE flow and the corresponding CICS trigger queue decommissioned. SAMA operational resilience requirements require a documented decommission record for each retired component.
Strategy Comparison
| Dimension | Strangler Fig (this article) | Big-bang Cutover | Rewrite-in-Place |
|---|---|---|---|
| Blast radius of a failure | One transaction type; rollback in <30 s | All transaction types simultaneously | Depends on legacy platform extensibility |
| Dual-run infrastructure cost | High: routing layer + both backends for 6–18 months | Low: short parallel window (days) | None: single codebase evolves |
| Validation depth | High: shadow mode gives weeks of evidence per transaction type | Low: UAT only, no production shadow | Medium: unit and integration tests in legacy stack |
| SAMA audit evidence | Strong: Prometheus history of divergence rates and rollback events | Weak: a date and a go/no-go decision | Medium: test reports from legacy platform |
| Team independence | High: each team migrates their transaction types independently | Low: all teams must be ready on the same date | Medium: shared legacy codebase creates merge risk |
| Rollback mechanism | ConfigMap patch; <10 s to full CICS | Requires restoring the full legacy path | Git revert; deployment cycle applies |
| Suitable for write operations | Yes, with shadow-first discipline and idempotency gates | Yes, with extensive UAT | Yes, constrained by legacy platform |