Software Sushi JournalArchitecture & cloud modernization
Modernize a Legacy Platform for AI Without a Full Rewrite
Attach AI behind clean read seams, async queues, and VPC data boundaries so your working core keeps shipping while you prove value.

Interactive architecture path
Four steps from a legacy core to a safe AI slice
Select each stage to inspect how writes, permissions, latency, and spend stay isolated from your core platform. Conceptual pattern, not one client deployment.
Leave the transactional core intact
Keep billing, auth, and primary tables inside the existing application. Expose one read-only view, replica, or outbox table where the new capability attaches without schema risk.
- Control boundary
- Legacy system owns all core writes
- Artifact passed forward
- Versioned read contract or outbox event
You do not need to rewrite a working platform before you add AI to it. Most teams stall when they tie a new AI capability to a full schema, framework, and cloud migration. A faster, safer path is to cut one narrow seam beside the existing core, isolate reads and inference behind a boundary, and prove the workflow on real traffic before touching critical transactions.
Teams running established products in healthcare, insurance, payments, or field operations rarely have the option to freeze the roadmap for a year. Customers rely on the existing billing rules, integrations, and reports. When you treat AI adoption as a full platform replacement, you inherit every legacy edge case before the first model output reaches a user.
Why full rewrites stall AI roadmaps
A big-bang rewrite mixes two separate kinds of uncertainty. Software migration risk comes from undocumented business rules, partner webhooks, and hidden data invariants built up over years. AI product risk comes from retrieval quality, model accuracy, latency, and whether users trust the output.
When both risks sit in the same project plan, neither can be measured early. Engineering spends months rebuilding auth, admin screens, and billing parity while the AI use case stays on a slide deck. If the model misses the accuracy bar at cutover, the team has already spent the budget on infrastructure parity.
The alternative follows Martin Fowler's strangler fig pattern (and AWS Prescriptive Guidance's transform, coexist, and eliminate lifecycle): place a clean boundary around one high-friction workflow, build the new service behind that seam, and expand only after production evidence justifies the next slice.
Pick one narrow seam in the existing stack
Start with the workflow that slows operators down today, not the oldest codebase in the repository. Good first seams produce drafts, classifications, triage tags, or structured extractions that a person or an existing rule checks before acting.
Three technical seams work reliably on older platforms without risking core uptime:
- Read replica or SQL view: expose only the columns needed for retrieval or scoring. The AI service gets read-only credentials and cannot lock or alter transactional tables.
- Transactional outbox or event queue: when the legacy app saves a ticket, claim, or document, write a small event row in the same database transaction. A separate worker reads the event, calls the model, and posts back a versioned draft.
- API gateway or reverse proxy route: route one new endpoint or document path to a containerized sidecar service while legacy endpoints stay untouched.
If you are still deciding whether to build that slice in-house or use an off-the-shelf tool, see our comparison on custom AI versus off-the-shelf AI and our AI proof of concept guide.
Compare a strangler seam against a full rewrite
Use the conceptual planner below to inspect how blast radius, rollback paths, and the first verifiable milestone change across three common legacy constraints.
Interactive trade-off explorer
Compare a strangler seam against a full rewrite
Monolithic web app with a shared relational database
One application handles UI, billing, reporting, and customer records in a single SQL schema that cannot accept downtime.
Recommended seam: Attach a read-replica or change-data-capture feed to a separate AI worker service, and return drafts to the existing UI behind a feature flag.
Strangler seam + sidecar AI service
Keep the core transactional tables untouched. Feed the AI service from a read-only view or event stream, then write back only versioned suggestions.
- Core database blast radiusContained
Isolated to a read replica or outbox feed; no schema rewrite on hot transactional tables.
- Latency on user requestsContained
Model calls run asynchronously off the request thread so core page loads stay predictable.
- Cloud and token budgetContained
Per-worker queue limits and right-sized compute cap spend from day one.
Protect latency, permissions, and sensitive data
Legacy systems often carry the company's real authorization rules and its most sensitive free-text fields. Two shortcuts break production deployments quickly: calling an LLM synchronously inside a web request, and copying raw records into a shared AI index without carrying forward caller permissions.
Keep model calls asynchronous whenever the user does not need a live token stream. Put explicit timeouts, bounded retries, and a dead-letter queue around every model call. If the provider slows down or returns malformed JSON, the legacy application should fall back to the existing manual or rule-based path instead of failing the transaction.
For teams handling customer PII or clinical PHI, enforce redaction and access control inside your own VPC before prompts leave the boundary. Store model outputs separately from authoritative records so reviewers can inspect what the model proposed alongside the source record. For detailed patterns, read our guides on PII and PHI redaction before the LLM and keeping model estimates distinct from recorded decisions.
Architecture checklist
Keep the legacy core isolated from AI failure modes
- 01Read seamReplica, SQL view, or outbox
- 02VPC boundaryPermissions + PII redaction
- 03Async workerQueue, timeouts, and eval gate
- 04Reviewed returnVersioned draft + rollback flag
- Grant the AI worker read-only database credentials; never let an experimental service alter core billing or customer tables.
- Carry forward caller permissions from the legacy app into retrieval filters rather than trusting prompt instructions.
- Put explicit timeouts, dead-letter queues, and a deterministic fallback around every external model call.
- Write AI proposals into a separate versioned table with model ID, prompt version, and input hash so reviewers can inspect or revert cleanly.
- Run shadow mode on read-only traffic and score against a labeled evaluation set before exposing outputs to customers.
- Audit idle cloud spend and tag AI compute separately from legacy workloads so infrastructure economics stay visible per workflow.
Cut cloud waste to fund modernization
Legacy platforms that grew organically on AWS, GCP, or Azure almost always carry idle instances, unattached volumes, oversized databases, and unmonitored test environments. Adding GPU endpoints or high-volume LLM API calls on top of unoptimized cloud spend turns an AI pilot into a finance objection.
In one AWS cloud cost optimization engagement, Software Sushi inventoried resources across accounts, removed idle compute and redundant storage, right-sized workloads to measured usage with zero downtime, and added drift monitoring. That audit cut monthly cloud spend by 62% without rewriting the application.
Treat infrastructure hygiene as phase zero of modernization. Set per-workflow token ceilings, tag AI worker compute separately from legacy workloads, and track cost per processed document or ticket before opening traffic to all customers. You can also explore our cloud cost optimization services or our AWS Cloud Modernization offering on AWS Marketplace.
When a core replacement is justified
An incremental seam is not a permanent excuse to ignore broken foundations. Plan a targeted replacement of a legacy subsystem when one of these hard blockers holds:
- Unsupported runtime or security exposure: the operating system, database engine, or framework no longer receives security patches and cannot be isolated inside a private segment.
- Data model corruption: source records lack stable identifiers or audit history, making it impossible to trace which record produced a model input.
- Hard throughput ceiling: the database or storage layer cannot sustain the read volume needed even on a replica.
Even then, replace one bounded domain at a time behind the same strangler contract rather than freezing the entire product for an all-or-nothing cutover.
Further reading
These public engineering references cover incremental system modernization, cloud reliability, and AI risk boundaries. They do not endorse Software Sushi or this article.
- Martin Fowler, Strangler Fig Application.
- Amazon Web Services, AWS Prescriptive Guidance: Strangler Fig Pattern.
- Amazon Web Services, AWS Well-Architected Cost Optimization Pillar.
- Amazon Web Services, AWS Well-Architected Reliability Pillar.
- National Institute of Standards and Technology, AI Risk Management Framework (AI RMF 1.0), January 2023.
Frequently asked questions
Do we need microservices before adding AI to a monolith?
No. One isolated worker or sidecar service reading from a replica, view, or event queue gives you independent scaling and clean rollback without splitting the rest of your monolith.
How do we prevent LLM latency from slowing down our core application?
Keep inference off the synchronous request path. Publish an event or enqueue a background job with a strict timeout, return the existing page immediately, and deliver the AI draft asynchronously or fall back to deterministic rules when the worker is unavailable.
How do we test an AI seam safely against legacy production data?
Start with synthetic fixtures and a labeled evaluation set. Once access filters and redaction rules pass review, run the worker in shadow mode on read-only traffic so you can measure accuracy, latency, and cost before exposing outputs to users.
Can cloud cost optimization really run without rewriting the platform?
Yes. Inventorying unused assets, right-sizing compute and databases to measured usage, and adding drift alerts typically require configuration and IaC changes rather than an application rewrite, as shown in our 62% AWS spend reduction case study.
Ship the first AI seam without risking your core platform
A legacy system that serves paying customers is an asset, not a blocker. Keep the working core steady, cut one testable seam for the AI workflow, enforce data and cost boundaries inside your cloud account, and let measured results guide what you modernize next.
If you want engineers who integrate AI into live stacks without forcing a disruptive rewrite, explore our AI integration services, cloud and modernization engineering, backend development, or book a discovery call.


