Cold starts in AWS Lambda are one of the most discussed and least understood performance problems in serverless .NET applications. I have built and maintained AWS Lambda services for years, and I have watched teams apply folklore fixes that do not address the actual latency contributors. Some optimizations help. Others add complexity without measurable improvement. The difference comes down to understanding what happens during a cold start and which parts of that process you can actually control. A Lambda cold start occurs when AWS provisions a new execution environment to handle a request. The runtime must initialize, the .NET assembly must load, and your application code must execute its startup logic before the first request completes. For .NET 6 and later on Lambda, this sequence includes downloading the deployment package, extracting it, loading the Common Language Runtime, JIT-compiling code, and running static constructors and dependency injection configuration. Each step con...
Most teams treat dependency injection as a way to make unit tests easier. They introduce an IoC container, wire up their constructors, and call it modernization. But when I worked through a legacy .NET modernization that moved monolithic services into testable, microservice-ready components, dependency injection turned out to be the single most important architectural lever—not because it made mocking easier, but because it forced us to name, own, and version the contracts between components that had been tangled together for years. The question was not whether to use dependency injection. The question was what boundary to inject across first, and how to do it without stopping feature delivery or introducing runtime failures that only appeared in production. The Boundary Problem Dependency Injection Surfaces Legacy .NET systems—especially those built before .NET Core and the rise of built-in DI containers—often mix construction, configuration, and execution in the same method. A...