October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
The Finance Base
The Money Desk · Blog
Re:

From Three-Tier EC2 to Serverless on AWS: What Changed in Cost, Complexity, and Constraints

A reported low-traffic migration from three-tier EC2 to Lambda cut monthly costs sharply, but shifted complexity into deployment, IAM, latency, and service limits.
From TheFinanceBase Team12 min to read

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A low-traffic AWS application in a published case study went from a reported $95–$100 per month on a three-tier EC2 setup to about $1–$6 per month after moving to Lambda and API Gateway. That is a useful example of how serverless can cut the cost of idle capacity—not a general price comparison. The result depended on the application’s traffic, existing DynamoDB database, removed network resources, and reported free-tier usage.

The central change was not simply replacing servers with functions. Compute, ingress, networking, deployment, debugging, and cost all changed shape. Serverless is most compelling when traffic is sporadic and the value of avoiding idle infrastructure outweighs the need for persistent processes, predictable latency, or conventional database connections.

What changed in the two architectures?

The case study, published March 18, 2026, describes a conventional three-tier deployment with two web-tier and two application-tier t3.micro instances. It also used external and internal load balancers, a NAT Gateway, DynamoDB, and VPC networking. The replacement retained the DynamoDB tables but removed the EC2 instances, load balancers, NAT Gateway, and VPC. It used two Lambda functions, two API Gateway APIs, and CloudWatch logging. The author’s account of the migration is a workload-specific report, not an independently reconstructed AWS bill.

  • Before: EC2 web tier → external load balancer → EC2 application tier → internal load balancer and network path → DynamoDB.
  • After: HTTP API v2 → Lambda running the Nuxt server-side-rendered frontend → REST API → Lambda running the Express backend → DynamoDB.

This was not the often-used static-site pattern of CloudFront and S3 serving a frontend without per-request application compute. Because the frontend rendered pages with Nuxt SSR, it still needed compute at request time. A static frontend could have a different cost and architecture. AWS’s serverless multi-tier reference describes the broader API Gateway, Lambda, and managed-service pattern, including IAM-based access to services such as DynamoDB and S3: AWS Serverless Multi-Tier Architectures.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the reported bill fell—and what the numbers do not prove

The case study attributed roughly $95–$100 per month to its earlier setup: about $15 for each pair of web- and application-tier instances, about $16 for each of two load balancers, more than $32 for the NAT Gateway, and roughly $1–$5 for DynamoDB. Its replacement was reported at about $1–$6 per month, with Lambda and API Gateway within the author’s observed free-tier use and DynamoDB and CloudWatch accounting for the remaining estimate. The report does not establish a universal AWS price ratio; actual charges vary by region, usage, data transfer, account eligibility, discounts, and configuration. See the case-study details.

The EC2 design had a recurring capacity floor: instances, load balancers, and network infrastructure cost money even when little work was being done. Lambda instead charges for requests and execution duration, measured in GB-seconds, and API Gateway meters API usage. AWS’s current Lambda pricing page lists a monthly free tier of 1 million requests and 400,000 GB-seconds, subject to applicable account and pricing terms. The free tier is not a promise that every serverless application will cost nothing: Lambda pricing and terms.

A more accurate shorthand is that serverless can remove or reduce the compute-capacity floor. It does not remove every baseline or usage charge. DynamoDB storage and features, log retention, network paths, data transfer, API Gateway options, provisioned concurrency, and any relational database can still contribute to the bill. AWS recommends evaluating the cost of the connected services and actual usage patterns, not Lambda in isolation: AWS Serverless Applications Lens: cost optimization.

Three different cost questions

  • Baseline: What is billed during long idle periods? Removing always-on compute and network resources may be valuable when traffic is sparse.
  • Marginal cost: How do requests, execution duration, API calls, data transfer, logs, and database use add up as traffic grows?
  • Total cost of ownership: What do engineering time, deployment work, observability, incidents, migration, and service-specific expertise cost the team?

At high, predictable utilization, an efficiently sized EC2 or container service—especially with applicable commitments—may be less expensive than metered compute. There is no defensible universal request-count break-even point: it depends on region, duration, memory, API type, data movement, database, discounts, and other choices. Model the actual workload with the AWS Pricing Calculator, and compare the full architecture rather than compute alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What infrastructure work disappeared, and what replaced it?

Work the team reduced

With no customer-managed EC2 fleet in the reported replacement, the team no longer had to keep those instances running, patch their operating systems, choose instance sizes, maintain Auto Scaling groups, or troubleshoot host processes over SSH. Removing the load balancers and NAT Gateway also removed those particular resources and their configuration from this deployment. AWS-managed scaling can reduce capacity planning, but the application still has to be designed for service quotas, cost, security, reliability, and observability. AWS’s guidance covers those wider concerns: AWS Serverless Applications Lens.

Work that moved into the application and deployment path

A Lambda handler is invoked for work; it is not an always-running server process waiting on a port. The case-study backend had to account for Express’s conventional app.listen() behavior. State that needs to survive an invocation must live outside the execution environment, and database connections, initialization, packaging, IAM permissions, and API routing need deliberate treatment.

Debugging also became more distributed. Instead of starting with a host, process, and load balancer, engineers may need to trace a request through API Gateway access logs, Lambda logs and metrics, IAM permissions, and downstream service diagnostics. A serverless design can reduce infrastructure operations while making the application’s failure path more dependent on service integration.

What the migration’s failures reveal

The case-study author described several deployment problems: the infrastructure configuration did not automatically adopt existing DynamoDB tables; frontend/backend requests hit CORS issues; a generic API Gateway 502 traced to missing IAM permissions; API stage-prefix routing needed adjustment; Nuxt static assets failed; and package-size pressure and build problems involved @nuxt/content. The author also reported a missing BatchWriteItem permission and a DescribeTable permission issue. These are examples from that migration, not a list of inevitable Lambda failures. The case account documents the specific problems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

They point to a practical lesson: a generic 502 is not a diagnosis. Correlate API Gateway access and integration logs with Lambda logs and request IDs, then check the handler response format, runtime errors, timeouts, IAM actions, routing, and network access. For infrastructure as code, decide whether an existing resource will be imported, referenced, or owned by a separate stack before deployment. Removing a resource declaration may avoid an attempted recreation, but it is not a universal ownership strategy.

When validating a deployed API, test its actual hostname and paths, including stage or custom-domain behavior, CORS origins, preflight OPTIONS requests, cookies, authorization headers, redirects, and static asset paths. Keep environment-specific API URLs out of frontend code where deployment configuration can supply them.

Cold starts and latency: measure the path users experience

The author reported an extra 2–3 seconds after inactivity for the Nuxt SSR frontend Lambda and less than one second for the backend Express Lambda in the observed test. Those are measurements from one application, not AWS-wide cold-start figures. Runtime, package size, initialization work, memory, architecture, VPC configuration, extensions, and traffic patterns can all affect startup and request latency. The reported measurements should be treated as a reason to test the application, not as a forecast for another function.

For an interactive SSR page, checkout flow, or other latency-sensitive path, compare cold and warm behavior at p50, p95, and p99. Include initialization duration, function duration, downstream database time, throttles, and errors. Provisioned concurrency keeps execution environments initialized to reduce initialization latency, but adds charges; reserved concurrency instead sets a concurrency limit and can protect downstream resources. The two controls serve different purposes: Lambda concurrency controls and provisioned concurrency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Accept variable startup latency: appropriate when low idle cost matters more than first-request consistency.
  • Pay for provisioned concurrency: consider it when a latency objective justifies the added baseline charge.
  • Keep a persistent service: EC2 or containers can suit workloads that need continuously warm processes and stable connection pools.
  • Split the paths: use warm compute only for latency-sensitive requests and Lambda for bursty or asynchronous work.

Lambda and API Gateway are elastic, not unlimited

Lambda’s documented function timeout maximum is 900 seconds (15 minutes), its memory setting ranges from 128 MB to 10,240 MB, and its default regional concurrency quota is 1,000, subject to account, region, and quota changes. AWS notes that memory affects allocated CPU and documents the relevant limits here: Lambda quotas. API Gateway’s account-level throttle quota is 10,000 requests per second with a 5,000-request burst in many regions; some regions have lower defaults. See API Gateway quotas.

Constraint Documented default or limit Why it matters
Lambda invocation duration Up to 900 seconds Long-running work may need a queue and worker service, ECS/Fargate, AWS Batch, or EC2.
Lambda memory 128 MB–10,240 MB Memory also affects allocated CPU; tune against measured duration and cost.
Lambda regional concurrency Default quota of 1,000 Quota can be raised, but concurrency must also fit database and downstream limits.
API Gateway account throttle 10,000 requests per second and 5,000 burst in many regions; lower defaults in some regions Check the applicable regional quota and request changes or design around it where needed.
Payloads and other service limits Service-specific Large uploads are often better sent directly to S3 than passed through a function and API request.

The complete path is constrained by its tightest component: client → API Gateway → Lambda concurrency → database throughput → downstream APIs. A rough concurrency estimate is requests per second multiplied by average request duration in seconds. For example, 50 requests per second at an average duration of 0.4 seconds implies about 20 concurrent executions under that average, before accounting for peaks and variation. AWS explains concurrency planning and protecting downstream systems in its concurrency guidance.

The database can decide whether the migration is easy

The source deployment retained DynamoDB, so it changed compute and ingress without demonstrating a relational-to-NoSQL migration. That distinction matters: moving a SQL application to DynamoDB can require redesigning data access, not just changing a connection string.

Keep or choose DynamoDB when access patterns fit

DynamoDB can suit key-value or document workloads with known access patterns, where horizontal scale and pay-per-request capacity are useful and arbitrary relational joins are not central. Its on-demand mode bills per request and automatically scales capacity, while storage and features such as backups, point-in-time recovery, streams, exports, DAX, and global tables have their own charges. Provisioned capacity can suit predictable throughput. Review DynamoDB pricing against the data model and workload rather than assuming it is always cheaper than a relational database.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep relational storage when the application depends on it

If the application relies on joins, SQL, relational transactions, or established PostgreSQL or MySQL tooling, keeping RDS or Aurora may be more practical than a data-model rewrite. Lambda does not require a serverless database. A hybrid can pair a static frontend on S3 and CloudFront with Lambda APIs and an existing relational database. Private database access may require a VPC, which changes the networking and cost picture.

Aurora Serverless is an option for some relational workloads, but it is not automatically inexpensive for a tiny intermittent application. AWS’s pricing examples vary by region, engine, storage, I/O, backups, and configuration; consult Aurora pricing for the configuration being considered.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

VPCs and API Gateway types are design choices, not universal rules

Use a VPC when the network boundary requires it

The reported Lambda functions accessed DynamoDB through AWS service APIs and did not need private access to a relational database, so the author removed the VPC. That does not make VPCs unnecessary for Lambda generally. Private RDS or Aurora, internal services, private APIs, segmentation, egress controls, compliance, and private connectivity may require one. VPC use brings subnet, security-group, routing, and possibly NAT Gateway or VPC endpoint decisions. AWS describes Lambda integration with VPC-hosted data stores alongside direct access to IAM-enabled services in its serverless architecture reference.

Choose HTTP API or REST API by required features

The case used an HTTP API v2 for the frontend and a REST API for the backend. Its author reported that changing the frontend API type addressed a stage-prefix routing problem in that deployment. This does not mean HTTP APIs always fix stage routing or that one type is universally preferable. Compare current feature support, existing tooling, private API needs, and cost before choosing. AWS’s API Gateway pricing page lists HTTP, REST, and WebSocket API pricing and related charges; consult the documentation for the feature set the application needs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Need What to evaluate
Simple Lambda-backed HTTP API and lower request cost HTTP API may be a fit; confirm the required features and integrations.
Broader API management features or an existing REST API setup Evaluate REST API capabilities and additional cost.
Persistent bidirectional connections Evaluate API Gateway WebSocket APIs or a service designed for persistent connections; do not assume ordinary Lambda/API requests provide them.
Private API connectivity Check API type, networking requirements, and PrivateLink-related charges.

A migration plan that tests the real trade-offs

  1. Establish a baseline. Record monthly requests, peak requests per second, average and tail latency, request duration, database reads and writes, storage and backups, transfer, log volume, and existing EC2, load-balancer, and NAT charges. Include maintenance and on-call work if comparing total ownership cost.
  2. Classify each workload. Separate static assets, SSR pages, synchronous APIs, long-running jobs, file uploads, and scheduled work. Consider S3 and CloudFront for static assets; Lambda for short-lived handlers; SQS with Lambda or another worker for asynchronous jobs; and direct-to-S3 uploads for large files.
  3. Decide whether to keep the database. A compute-and-ingress migration can preserve an existing database. Moving from a relational model to DynamoDB should be planned as a data-model redesign with access patterns and query requirements, not bundled casually into a compute change.
  4. Define IAM permissions deliberately. Give each function only the actions it needs. Depending on its code, that might include dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem, dynamodb:BatchWriteItem, or dynamodb:DescribeTable; do not grant the list blindly.
  5. Set resource ownership before deployment. Decide whether existing tables are imported into infrastructure as code, referenced by the application stack, or managed in a separate stack. Verify the framework’s behavior rather than assuming it will adopt an existing resource.
  6. Validate the deployed routes and browser behavior. Test the real hostname, stage or custom-domain paths, CORS and preflight requests, cookies, auth headers, redirects, and static assets.
  7. Measure cold and warm traffic separately. Record initialization and execution durations, p50/p95/p99 latency, errors, throttles, and database time after idle and during repeated requests.
  8. Set concurrency against downstream capacity. Estimate demand from request rate and duration, then load-test peaks and database connections. Use reserved concurrency where a cap is needed; assess provisioned concurrency separately if latency requires it.
  9. Set cost and operational controls. Configure budgets and alerts, log retention, function duration and error alarms, API and database throttling alarms, and cost allocation tags. Add dashboards or anomaly detection appropriate to the production risk.
  10. Price a hybrid control case. Compare the proposed design with alternatives such as CloudFront/S3 plus Lambda and the existing database, or CloudFront/S3 plus an ECS/Fargate service and RDS/Aurora. The best answer may be a split architecture rather than an all-or-nothing migration.

Which compute model fits the workload?

Option Often a good fit when Main trade-off
Lambda and API Gateway Traffic is sporadic or unpredictable; handlers are short-lived; idle cost matters; the team accepts variable startup latency and service-based debugging. Metered requests and duration, concurrency and service quotas, distributed troubleshooting, and possible cold-start mitigation cost.
EC2 Traffic is steady and instances can stay well utilized; persistent processes, OS control, stable caches, or long-running work matter. Capacity remains a customer-managed responsibility, including patching, sizing, health, and scaling.
ECS with Fargate The application suits a persistent container service, needs longer-running processes, or is awkward to divide into handlers, but the team wants not to manage EC2 hosts. Running tasks create a capacity floor; it is not the same per-invocation cost model as Lambda.
Hybrid Static content, bursty APIs, relational storage, background jobs, or latency-sensitive paths have different needs. More than one compute and deployment pattern requires clear ownership and observability.

How to decide

  • Lean toward Lambda when requests are short and intermittent, idle charges matter, the team can tolerate or mitigate variable startup latency, and database or downstream capacity can absorb bursts.
  • Lean toward EC2 or containers when traffic is sustained and predictable, long-running or connection-heavy processes are important, the application needs a warm runtime, or operating a persistent service is simpler for the team.
  • Use a hybrid when static content can be separated, only some routes are bursty, a relational database must remain, or background tasks do not belong on the synchronous request path.

The reported migration was economical because it removed an always-on infrastructure floor from a low-traffic application while keeping its DynamoDB tables. It also traded host administration for handler-based application work, service integration, deployment, and observability. That is the useful comparison: not whether serverless is inherently cheaper or simpler, but whether its cost model and operating constraints fit this workload better than EC2 or containers.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More post from the Money Desk

  1. The Money DeskBlogTheFinanceBase09 OCT 267 minMortgage Escrow FAQs: Taxes, Insurance, Shortages, and Refunds
  2. The Money DeskBlogTheFinanceBase09 OCT 265 minHow Mortgage Escrow Accounts Work and What Homeowners Pay For
  3. The Money DeskBlogTheFinanceBase09 OCT 265 minHow to Read a Stock Chart, Volume and Market-Cap Data
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.