1
0 Comments

The Mainframe Mandate: Ankur Bhatnagar on Why Legacy Modernization Demands an API First Core

A mainframe is like an old iron railroad, built to last but impossible to reroute without shutting down the whole line. In modern retail, that same rigidity creates a modernization trap where innovation stalls before it ever reaches the customer. The mainframe modernization market is projected to expand from $8.39 billion in 2025 to $13.34 billion by 2030, a clear sign of the massive shift underway.

E‑commerce. Inventory. Payment gateways. Each channel is optimized separately, yet the integration layer must remain unified. For a large retailer handling thousands of daily transactions, delivering the right product availability at the exact moment a customer clicks buy requires a resilient pipeline that can route traffic from legacy mainframes to cloud services without breaking.

Ankur Bhatnagar, a Staff Software Engineer and Senior IEEE Member, has spent over 20 years at the intersection of legacy mainframes and API led integration. Bhatnagar led the design of API proxies on Apigee X that replaced legacy mainframe calls, enabling the Mainframe Zero program to retire 120 core applications and more than 200 distributed apps while saving an estimated $30 million annually.

You worked on Mainframe Zero, a program designed to retire decades old mainframe infrastructure while keeping retail operations intact. What was the actual problem underneath all the buzzwords?

Tight coupling. The legacy mainframe had been running for decades. Every internal system, every vendor integration, every store terminal talked directly to it. Changing anything meant risking everything. The retailer needed to move to Google Cloud, but you cannot just unplug a mainframe that processes thousands of daily transactions. The whole railroad stops.

My role was to insert an API gateway, Apigee X, between the old world and the new. Instead of letting systems call the mainframe directly, we rerouted them through APIs. Those APIs then decided whether to send a request to the old mainframe or the new cloud service. The customer never noticed the switch.
This approach decoupled the front end from the legacy backend. It gave us a control plane where we could slowly move functionality to the cloud, test it, and only cut over when safe. No big bang. No all night outages.

You analyzed hundreds of existing mainframe service interactions and designed API proxies to replace them. How do you replace something that critical without causing a retail mageddon during Black Friday?

Very carefully. First, I mapped every dependency, failure mode, and performance baseline. There were hundreds of service calls, some undocumented. I had to reverse engineer behavior by observing production traffic. Then I designed Apigee API proxies as the wrapper services that behaved exactly like the old services in mainframe and Apigeex was seamlessly able to connect the services in GCP . Same inputs, same outputs, same error messages, same latency characteristics.

We built a kill switch into every proxy. If the new API proxy failed for any reason, such as a timeout, authentication error, or malformed response, traffic would instantly fall back to the original mainframe call. The customer would see nothing. That safety net gave us the confidence to migrate one service at a time, starting with read only queries before moving to writes.

The retailer never experienced a full outage during the migration, not even during peak seasonal traffic. We also used automated canary testing. We sent 5% of traffic to the new API, monitored for errors, then 20%, then 50%. Only when error rates matched zero did we cut over fully.

AI and large language models will drive more than 30% of new API demand by 2026. That shift makes API first modernization not optional but urgent.

You built an API first architecture that now allows the retailer to plug in AI engines without touching the mainframe. How does that trend toward AI driven APIs connect directly to what you implemented in Mainframe Zero?

Legacy mainframes were never designed for AI. They cannot expose real time inventory, pricing, or customer data to LLMs without a modern API layer. Their internal protocols are proprietary, their data formats are fixed, and they have no concept of token based authorization for external services.

By replacing mainframe service functionality in GCP and wrapping them with Apigee X, we created that missing layer. Now the retailer can plug in AI engines for personalized recommendations, demand forecasting, or chatbot support without touching the mainframe. The API gateway handles authentication, rate limiting, and data transformation. The AI tools just call REST endpoints.

This is not theoretical. During the perf testing,, the retailer used an LLM to adjust real time pricing based on inventory and competitor data. That required sub second API responses from the mainframe sourced data. Without our API layer, that would have been impossible. The mainframe stayed untouched, and the AI got clean, fast data.

The legacy mainframe environment had serious security gaps, including unencrypted internal calls and no token validation. What specific security gaps did you find, and how did you fix them?

The legacy environment had massive security gaps. Most internal service calls were unencrypted, meaning plain HTTP over the corporate network. Anyone with network access could sniff inventory data, customer signals, or payment metadata. There was no token validation, no mutual TLS, no centralized logging. Authentication was often based on source IP address, which is trivially spoofed.

We moved everything to HTTPS with mutual TLS and OAuth 2.0. Every API call required a valid JWT token, scoped to the specific service and user. We implemented centralized access control at the Apigee layer, not scattered across dozens of mainframe programs. All traffic was logged and monitored.

These are exactly the patterns reviewed at ICAMC‑2026, where I serve as a Judge. The conference focuses on zero trust architecture and API security. What we built in Mainframe Zero aligns directly with those principles. Never trust the internal network, always verify. The mainframe no longer decides who can call it, the API gateway does.

You have extensive experience in API governance and centralized policy management. What is the single most important governance lesson from Mainframe Zero that other enterprises should adopt?

Do not treat APIs as point-to-point connectors. Treat them as products. In Mainframe Zero, we built what we called Governance as Code from day one. Every API proxy had to pass through automated policy checks: rate limiting, authentication, logging, version control, and schema validation. These policies were written into our CI/CD pipelines, not as a separate compliance step.

This prevented the usual modernization failure: sprawl. Without governance, teams create thousands of undocumented, inconsistent APIs. Soon you have the same tight coupling you tried to escape, just with REST instead of mainframe calls. By enforcing standards at the gateway level, we ensured every new API was discoverable, secure, and reusable.

The result? Internal teams can now build new features in days instead of weeks. They do not need to ask permission or reverse engineer mainframe logic. The governance layer is not a bottleneck; it is an accelerator. Standardized logging also means we can trace any failure to the exact API call and version, cutting debugging time by 70%.

Global public cloud spending is forecast to surpass $1 trillion in 2026, growing more than 21% year over year. That wave will lift retailers who have an API first core and sink those still locked to mainframes.

You have firsthand experience replacing a rigid mainframe core with an API first integration layer. What is your one piece of advice for retailers still stuck on mainframe logic?

Do not try to migrate everything at once. That is the mistake that kills modernization projects. Replace the integration layer first. Turn every legacy service call into an API, with a kill switch and canary testing. Then you can move workloads to the cloud one by one, with no forced downtime and no all or nothing bet.

The quiet impact of this work is measured in what does not happen. No unplanned outages during the perf testing. No security breaches from unencrypted internal calls. No multi million dollar licensing surprises. The mainframe stays running as long as you need it, but it becomes a background utility, not a cage.

Modernize the core, or the core will eventually break. That is not a threat; it is just physics. Every mainframe has a shelf life. Every legacy system eventually loses vendor support. The only question is whether you replace the integration layer on your own terms or during a crisis.

on May 5, 2026
Trending on Indie Hackers
I've been building for months and made $0. Here's the honest psychological reason — and it's not what I expected. User Avatar 166 comments Agencies charge $5,000 for a 60-second product demo video. I make mine for $0. Here's the exact workflow. User Avatar 152 comments This system tells you what’s working in your startup — every week User Avatar 51 comments 11 Weeks Ago I Had 0 Users. Now VIDI Has Reviewed $10M+ in Contracts - and I’m Opening a Small SAFE Round User Avatar 41 comments I built a health platform for my family because nobody has a clue what is going on User Avatar 15 comments Most teams think they have a detection problem. They don't. User Avatar 8 comments