Chapter 33 Exercises: Strangler Fig Pattern for Mainframes
Part A: Conceptual Questions
A1. Explain the strangler fig metaphor in your own words. Where does the biological metaphor accurately map to software modernization, and where does it break down? Identify at least two ways that extracting a COBOL service from a CICS system is harder than a vine growing on a tree.
A2. The chapter states that the facade must satisfy four requirements: transparent to consumers, stateless, observable, and reversible. For each requirement, explain why violating it leads to a specific failure mode. Give a concrete example of what goes wrong for each violation.
A3. Carlos Vega's 4 AM incident was caused by a 47-second CDC lag during batch processing. Explain why CDC latency spikes during batch windows. What is the relationship between DB2 log volume and CDC throughput? Propose two architectural solutions beyond the "freshness indicator" that SecureFirst implemented.
A4. Compare and contrast the four data synchronization patterns (Legacy as Source of Truth, Dual-Write with Legacy Priority, Event Sourcing, and Shared Database). For each pattern, identify the data consistency guarantee it provides and the scenario where it is the appropriate choice.
A5. The chapter's extraction scorecard uses the formula: Priority = (Business Value x 3 + Change Frequency x 2 + Risk Tolerance) / (Technical Complexity + Data Coupling). Explain why Business Value is weighted 3x and Change Frequency is weighted 2x. Propose an alternative weighting scheme for an organization whose primary modernization driver is cost reduction rather than agility, and justify your weights.
A6. Explain why "starting with Fund Transfer" is an anti-pattern even though it has the highest business value. What organizational and technical risks does an early extraction of a write-heavy, mission-critical service create? How does a failed first extraction affect the trajectory of the entire strangler fig program?
A7. The chapter states that the minimum standby period before decommissioning should cover the longest periodic cycle plus a buffer — typically 90-180 days. Sandra Chen's team discovered a module called by a quarterly regulatory batch job after only 88 days of standby. How would you systematically identify all periodic callers of a module before decommissioning? What tools and techniques are available on z/OS for this analysis?
A8. Diane Okoye at Pinnacle Health recommended stopping the strangler fig after extracting the services around the claims adjudication engine, leaving the core engine on CICS. Under what circumstances would you agree with this recommendation? Under what circumstances would you push to extract the adjudication engine itself? What data would you need to make this decision?
Part B: Applied Analysis
B1. Extraction Scorecard for an Insurance Company
A mid-size health insurance company runs the following services on CICS/DB2. Score each on the five extraction dimensions and calculate the priority score. Recommend an extraction order.
| Service | Description | LOC | DB2 Tables | MQ Queues | Daily Trans. |
|---|---|---|---|---|---|
| ELIGCHK | Real-time eligibility verification for providers | 18K | 4 (reads only) | 0 | 45,000 |
| CLMSTAT | Claims status inquiry for members | 12K | 3 (reads only) | 0 | 22,000 |
| CLMADJ | Claims adjudication engine | 340K | 27 (reads + writes) | 6 | 12,000 |
| PRVLKP | Provider network lookup | 8K | 2 (reads only) | 0 | 35,000 |
| AUTHADJ | Pre-authorization adjudication | 85K | 12 (reads + writes) | 3 | 8,000 |
| MEMUPD | Member information update | 22K | 8 (reads + writes) | 2 | 3,500 |
| BENPAY | Benefits payment processing | 110K | 15 (reads + writes) | 4 | batch only |
| EOBGEN | Explanation of Benefits generation | 45K | 6 (reads only) | 1 | batch only |
For each service, provide: - Scores on all five dimensions with brief justification - Calculated priority score - Recommended extraction phase (Phase 1: first 6 months, Phase 2: 6-12 months, Phase 3: 12-18 months, Phase 4: Leave on mainframe) - Key risk to monitor during extraction
B2. Data Synchronization Design
You are the architect for a strangler fig extraction of a balance-inquiry service from a CICS/DB2 system. The service reads from three DB2 tables:
ACCOUNT_MASTER— 15 million rows, updated by 12 different COBOL programs, 500,000 updates/dayACCOUNT_HOLDS— 2 million rows, updated by 4 COBOL programs, 80,000 updates/dayDAILY_TRANSACTIONS— 200 million rows, insert-only, 3 million inserts/day
Design the CDC pipeline for this extraction:
a) Which CDC tool would you recommend (IBM IIDR, Debezium, IBM Data Gate) and why?
b) What is the expected CDC latency under normal load? During peak batch processing?
c) How will you handle the initial load of 200 million rows in DAILY_TRANSACTIONS?
d) What happens when the DBA adds a column to ACCOUNT_MASTER?
e) What monitoring metrics and alert thresholds would you configure?
f) What is your runbook for a CDC pipeline failure at 2 AM?
B3. Facade Design Exercise
Design the API gateway routing configuration for a strangler fig migration of three services: Balance Inquiry (currently in canary phase, 25% modern), Transaction History (currently in shadow mode), and Fund Transfer (still 100% legacy, no extraction planned).
Your design must include: a) The Kong (or equivalent) route definitions for all three services b) Traffic-splitting rules for Balance Inquiry c) Shadow mode configuration for Transaction History d) The rollback procedure for each service e) The comparison engine rules for each service (which fields are compared, what tolerance is acceptable, what triggers an alert) f) Rate limiting rules to protect the legacy system during the transition
B4. Parallel Running Analysis
The following comparison engine output shows discrepancies between the legacy and modern balance-inquiry services during parallel running. Analyze each discrepancy and determine: (a) whether it is a genuine bug, a timing issue, or a configuration issue, and (b) what action to take.
| Request ID | Account | Legacy Balance | Modern Balance | Timestamp Diff | CDC Lag |
|---|---|---|---|---|---|
| REQ-44201 | 10045892 | $12,456.78 | $12,456.78 | 0.3s | 2.1s | |
| REQ-44202 | 10089341 | $3,201.15 | $3,201.14 | 0.2s | 1.8s | |
| REQ-44203 | 10112005 | $8,944.00 | $8,744.00 | 0.1s | 2.0s | |
| REQ-44204 | 10045892 | $12,256.78 | $12,456.78 | 0.4s | 45.2s | |
| REQ-44205 | 10201445 | $0.00 | $-142.50 | 0.1s | 1.5s | |
| REQ-44206 | 10334112 | $5,678.90 | $5,678.90 | 0.2s | 2.3s | |
| REQ-44207 | 10089341 | $3,201.15 | $3,201.15 | 0.3s | 1.9s | |
| REQ-44208 | 10401998 | $22,100.00 | $22,099.99 | 0.2s | 2.0s |
Questions: a) Which requests show exact matches? b) REQ-44202 and REQ-44208 show 1-cent discrepancies. What is the likely root cause? How do you confirm? c) REQ-44203 shows a $200 discrepancy with low CDC lag. What should your immediate action be? d) REQ-44204 shows a $200 discrepancy with high CDC lag (45.2s). Is this the same issue as REQ-44203 or a different one? How do you determine which? e) REQ-44205 shows the modern service returning a negative balance while the legacy returns $0.00. What business logic difference might explain this? Which is correct? f) Based on this data, should you proceed to canary deployment? Why or why not?
Part C: Design and Implementation
C1. Strangler Fig Plan Document
Choose a COBOL system you have access to (or use the HA Banking Transaction Processing System from the progressive project) and create a complete strangler fig plan document for extracting one service. Your plan must include:
- Service selection justification — extraction scorecard with scores and rationale
- Seam analysis — where are the clean extraction points in the COBOL code?
- Facade design — which implementation option (A, B, or C from Section 33.2.2) and why
- Data synchronization strategy — which pattern, CDC tool selection, latency targets
- Testing strategy — shadow mode duration, parallel running thresholds, canary rings
- Rollback procedure — step-by-step, with triggers and verification steps
- Completion criteria — when is the extraction "done"?
- Risk register — at least six risks with probability, impact, and mitigation
- Timeline — week-by-week plan from preparation through decommission
- Budget estimate — infrastructure, tooling, team time, parallel running costs
Target length: 15-20 pages. This is a deliverable you could present to a steering committee.
C2. Comparison Engine Implementation
Implement the comparison engine described in Section 33.4.3. Use any language you prefer. Your implementation must:
- Accept two JSON responses (legacy and modern) for the same request
- Compare each field according to configurable comparison rules (exact match, tolerance-based, pattern match)
- Classify each discrepancy by severity (Critical, Warning, Info)
- Calculate aggregate match rates (overall, by field, by severity)
- Determine whether the current ramp-up phase should continue, hold, or rollback based on configurable thresholds
- Output a structured report suitable for the strangler fig dashboard
Test your implementation against the data from Exercise B4.
C3. CICS Web Service Wrapper
Write the complete CICS web service wrapper for a Transaction History service. The legacy CICS program (TXNHIST) accepts a COMMAREA with: - Account number (PIC X(12)) - Start date (PIC X(10), format YYYY-MM-DD) - End date (PIC X(10), format YYYY-MM-DD) - Maximum rows (PIC 9(4) COMP)
And returns: - Return code (PIC X(2)) - Number of transactions returned (PIC 9(4) COMP) - Array of up to 100 transactions, each containing: - Transaction date (PIC X(10)) - Description (PIC X(40)) - Amount (PIC S9(11)V99 COMP-3) - Running balance (PIC S9(13)V99 COMP-3) - Transaction type (PIC X(2))
Your wrapper must: 1. Receive JSON from the CICS web service pipeline 2. Map to the COMMAREA layout 3. LINK to TXNHIST 4. Map the response (including the variable-length array) back to JSON 5. Include correlation ID propagation 6. Handle all error conditions (program not found, COMMAREA overflow, timeout)
C4. Routing Configuration for Multi-Service Strangler Fig
Design and write the complete API gateway configuration (Kong YAML, AWS API Gateway CloudFormation, or equivalent) for a strangler fig migration involving six services at different phases:
| Service | Phase | Modern % | Shadow | Comparison |
|---|---|---|---|---|
| Balance Inquiry | Canary Ring 3 | 50% | No | Active |
| Transaction History | Canary Ring 1 | 5% | No | Active |
| Account Summary | Shadow | 0% | Yes | Active |
| Fund Transfer | Legacy only | 0% | No | None |
| Bill Payment | Legacy only | 0% | No | None |
| Account Maintenance | Preparation | 0% | No | None |
Your configuration must include all routing rules, traffic-splitting configurations, shadow mode setup, comparison engine integration, rate limiting, and health check definitions.
Part D: Critical Thinking
D1. A vendor proposes an "automated strangler fig" tool that can "automatically extract any COBOL CICS transaction to a Java microservice in 4-6 weeks per service." The tool analyzes the COBOL source code, generates equivalent Java code, creates the API gateway configuration, and sets up CDC. Evaluate this proposal. What would you ask the vendor? What are the likely limitations? Under what very specific circumstances might such a tool be useful?
D2. Your CTO reads about event sourcing and decides that the strangler fig migration should use Pattern 3 (Event Sourcing) for all data synchronization. Write a memo explaining why this is impractical for a brownfield mainframe migration and proposing an alternative approach. Be specific about the technical barriers to retrofitting event sourcing onto an existing COBOL/DB2 system.
D3. Two years into a strangler fig migration, the organization has extracted 8 of 14 planned services. The remaining 6 are the most complex (fund transfer, wire transfer, loan origination, interest calculation, regulatory reporting, and GL posting). The CFO asks: "We've spent $12 million. How much more to finish?" How do you answer this question honestly? What data do you present? What recommendation do you make?
D4. Pinnacle Health's strangler fig left the claims adjudication engine on CICS. Three years later, the two COBOL developers who maintain it announce their retirement. No replacements have been hired. The adjudication engine is now a single point of organizational failure — not a technical failure, but a knowledge failure. How should Pinnacle respond? Is this a failure of the strangler fig strategy, a failure of workforce planning, or both?
D5. During parallel running of a fund-transfer service, the comparison engine shows a 0.2% discrepancy rate on the transfer amount field. Investigation reveals that the discrepancy occurs only for transfers involving accounts with a specific fee structure (tiered overdraft protection). The modern service calculates the fee differently than the COBOL program. Both calculations are defensible interpretations of the fee schedule. Who decides which is "correct"? What process should you follow to resolve this? What are the regulatory implications of changing how fees are calculated?
Part E: Progressive Project Integration
E1. Complete the project checkpoint (code/project-checkpoint.md) for your HA Banking Transaction Processing System. This involves designing the complete strangler fig plan for extracting the balance-inquiry service to a modern microservice.
E2. Write the COBOL web service wrapper (similar to BALWSSRV in Section 33.4.1) for your HA banking system's balance-inquiry program. Adapt it to your system's specific COMMAREA layout and data structures from Chapter 14's project checkpoint.
E3. Design the CDC pipeline for your HA banking system's account data. Specify: the source tables, the CDC tool, the target database, the latency targets, the monitoring metrics, and the failure handling procedures.
E4. Create the comparison engine rules for your balance-inquiry service. For each field in the response, specify: the comparison type (exact, tolerance, pattern), the tolerance (if applicable), the severity (critical, warning, info), and the action on mismatch.
E5. Write the rollback procedure for your strangler fig implementation. Include: trigger conditions, rollback steps, verification steps, notification procedures, and the post-rollback analysis process. Test the procedure against the scenario: "The modern service starts returning 500 errors for 2% of requests during Canary Ring 2."