A Cost-Conscious AWS Architecture for a Startup Web App

CloudFront serves a private S3 frontend over HTTPS beside a pay-per-use API Gateway, Lambda, and DynamoDB backend.

Explore diagram

Explore on mobile. Create and edit manually or with AI on a computer.

Cost-conscious AWS web app diagram with CloudFront serving private S3 assets and a separate browser path through API Gateway, Lambda, and DynamoDBExplore diagram

Cost-conscious AWS web app diagram with CloudFront serving private S3 assets and a separate browser path through API Gateway, Lambda, and DynamoDB. Open the image to explore this ready-made diagram.

Overview

CloudFront serves the static frontend over HTTPS from a private Amazon S3 origin. The browser calls Amazon API Gateway separately for backend operations. AWS Lambda runs application logic only when invoked, and DynamoDB stores data with on-demand capacity, keeping idle application-compute cost low.

Components

  • CloudFront and Private S3: CloudFront caches the frontend and uses origin access control to retrieve assets from a private S3 REST origin.
  • API Gateway: Publishes managed HTTPS routes and scales without reserved application capacity.
  • Lambda and DynamoDB: Run product logic and store records with pay-per-request starting points.

Application Flow

  1. A browser loads the frontend over HTTPS from CloudFront, which retrieves uncached assets from the private S3 origin.
  2. The frontend sends dynamic requests to API Gateway.
  3. API Gateway invokes the Lambda function for product operations.
  4. Lambda reads and writes product records in the on-demand DynamoDB table.

Customize First

  • Set budgets and billing alarms before inviting users.
  • Tune CloudFront cache policies and restrict the S3 bucket policy to the intended distribution.
  • Add authentication when the product begins storing user-specific data.
  • Revisit reserved capacity after traffic becomes predictable enough to justify it.

Related AWS guides

Use these practical explanations to compare services, failure boundaries, and operating tradeoffs before adapting the architecture.

Design rationale

Decisions that shape this architecture

1

Avoid paying for idle application servers

API Gateway and Lambda charge mainly when requests arrive. This is attractive before traffic becomes stable enough to justify reserved compute.

2

Separate the static frontend from the API

CloudFront serves the built application from S3 using origin access control, while browser API calls follow their own API Gateway path. Frontend delivery and backend scaling can change independently.

3

Delay capacity commitments

DynamoDB on-demand capacity is simple during uncertain growth. Revisit provisioned or reserved pricing after usage becomes predictable.

Before production

Operational checks

Create AWS Budgets and billing alarms before inviting users.

Set concurrency, API throttling, and data-retention limits to bound surprise spend.

Track cost per request and cost per active user as the product grows.

Review CloudWatch log retention because verbose logs can become a material cost.

Scope and tradeoffs

What this diagram does not solve

Low idle cost is not always the lowest unit cost

At sustained high volume, containers, reserved compute, or provisioned database capacity may deliver a lower cost per request.

The minimal version omits several launch controls

Add authentication, backups, alarms, least-privilege IAM, and deployment automation according to the product risk. Configure CloudFront origin access control and S3 Block Public Access so the asset bucket stays private.

Common questions

Frequently asked questions

Why is serverless attractive for a startup?

It reduces server operations and idle compute cost while traffic is small or unpredictable, letting the team defer capacity planning.

Is S3 website hosting enough for production?

This starter uses CloudFront with a private S3 REST origin for HTTPS delivery and origin access control. It does not expose the S3 website endpoint directly.

When should the architecture move away from on-demand pricing?

Review alternatives when traffic and storage patterns are stable enough to compare reserved or provisioned options with the operational cost of changing them.

Keep exploring

Explore the library
Serverless REST API AWS architecture diagram with API Gateway, AWS Lambda, DynamoDB, and CloudWatch
Getting Startedbasic

Serverless REST API Architecture on AWS

This is the serverless API baseline that most production APIs grow from rather than away from: a managed HTTPS entry point, stateless function compute, on-demand data storage, and observable execution. It is deliberately compact so the first real decisions stay legible. Adding authentication, caching, asynchronous work, and a second Region each attaches to this shape without replacing it, which is why it is worth understanding before the additions arrive.

Explore the architecture
Serverless multi-tenant SaaS AWS architecture diagram with CloudFront, WAF, Cognito, API Gateway, Lambda, EventBridge, SQS, DynamoDB Streams, and S3
SaaS Backendadvanced

Serverless Multi-Tenant SaaS Architecture on AWS

This architecture combines a protected synchronous API with a durable asynchronous work path. Tenant identity travels from Cognito into application authorization, domain events decouple background work, and DynamoDB plus S3 provide scalable tenant state and assets.

Explore the architecture
Amazon ECS Fargate web architecture diagram with CloudFront, WAF, a multi-AZ ALB, private Fargate tasks, RDS, and ElastiCache
Containersadvanced

Containerized Web Service with Amazon ECS and Fargate

This architecture shows the running service: a protected global edge, a Multi-AZ load balancer, private Fargate tasks, and managed data services. It is a useful starting point for teams outgrowing a single server or a function-based API; deployment, credential delivery, and monitoring can be added around that request path.

Explore the architecture

Ready-made AWS diagram

Explore this AWS architecture

Open the diagram from this guide and explore how it works. Create and edit manually or with AI on a computer.

Explore diagram