Legacy applications are expensive to maintain, slow to change, and difficult to scale. But "big bang" rewrites rarely succeed. The path forward is incremental modernization—extracting services, containerizing workloads, and adopting managed services piece by piece, proving value at each step.
Key Modernization Patterns
Serverless Migration
Lambda, API Gateway, and managed services for workloads that benefit from pay-per-use pricing and automatic scaling. Ideal for APIs, event processing, and scheduled jobs.
Containerization
ECS or EKS for applications that need more control over runtime or have long-running processes. Consistent environments from dev to production.
Strangler Fig Pattern
Gradually replace monolith functionality with new services, routing traffic incrementally. Reduces risk and delivers value continuously.
Event-Driven Architecture
EventBridge, SQS, and SNS for decoupled, scalable systems. Break apart tightly coupled components and enable independent scaling.
Lambda vs. ECS: Making the Right Choice
This is the most common question I get from .NET teams. Here's my decision framework:
| Factor | Choose Lambda | Choose ECS/EKS |
|---|---|---|
| Traffic Pattern | Sporadic, variable | Sustained, predictable |
| Execution Time | < 15 minutes | Long-running processes |
| Cold Start Tolerance | Acceptable (or use AOT) | Not acceptable |
| Cost at Scale | Low-medium volume | High volume (cheaper) |
| Team Experience | New to containers | Container-native |
My Approach
I start with assessment—understanding your application portfolio, dependencies, and business priorities. Not everything needs to be modernized, and not everything should be serverless. The goal is matching the right pattern to each workload.
For .NET teams, I focus on the path from .NET Framework to modern .NET on Linux, whether that's Lambda or containers. For Node.js, it's often about breaking apart monolithic Express apps into focused services. Both benefit from proper CI/CD foundations before the migration starts.
I prefer pilot projects that prove the approach before committing to a full portfolio migration. One successful service migration teaches your team the patterns and builds confidence for what comes next.
.NET Modernization on AWS
.NET has come a long way on AWS. Lambda now supports .NET 8 with Native AOT compilation, which dramatically reduces cold starts—from 2-3 seconds down to 200-400ms. For teams still on .NET Framework, the migration path to modern .NET is well-documented, and tools like the .NET Upgrade Assistant help identify compatibility issues early.
I've written about serverless optimization patterns including AOT compilation trade-offs and when Lambda isn't the right choice.
Frequently Asked Questions
Should I use Lambda or ECS for my .NET application?
It depends on your workload pattern. Lambda excels for sporadic, event-driven workloads with variable traffic—you pay nothing when idle. ECS is better for sustained high-throughput workloads, long-running processes, or applications that need more than 15 minutes of execution time. For .NET specifically, Lambda with Native AOT compilation has dramatically improved cold starts, making it viable for more use cases.
How do I migrate from .NET Framework to .NET 8+?
Start with the .NET Upgrade Assistant tool to assess compatibility. Most ASP.NET MVC and Web API applications migrate relatively smoothly. The biggest challenges are usually Windows-specific dependencies, COM interop, and third-party libraries that haven't been updated. I recommend a strangler fig approach—migrate one service at a time.
What's the strangler fig pattern?
Named after strangler fig trees, this pattern gradually replaces a legacy system by routing traffic to new services one feature at a time. You put a routing layer in front of both systems, then incrementally shift endpoints from old to new. This reduces risk compared to big-bang rewrites and delivers value continuously.
How long does a typical modernization project take?
It varies based on complexity, but a realistic timeline for a medium-sized .NET application (10-20 services) is 6-12 months for full modernization. However, you should see value much sooner—the first service migration typically takes 4-8 weeks, and each subsequent service gets faster as the team builds expertise.
Is serverless actually cheaper than EC2?
Not always. Lambda is cost-effective for sporadic workloads. But at sustained high throughput (millions of invocations per day), EC2 or ECS with Reserved Instances can be 50-70% cheaper. The break-even point depends on your specific traffic patterns.