Skip to content
← Back to Home

Serverless URL Platform

Serverless URL shortening platform built on Lambda, API Gateway, and DynamoDB.

API GatewayLambdaDynamoDBCloudFront

Overview

A serverless URL shortening platform that demonstrates how modern cloud architectures automatically scale to handle unpredictable internet traffic while maintaining low operational cost, high availability, and minimal infrastructure management.

Read more about the architecture and its broader applications

Internet platforms use shortened URLs for marketing campaigns, messaging platforms, and social media distribution.

The infrastructure behind a redirect service must handle unpredictable traffic. A single shared link can generate thousands of requests in seconds.

Traditional servers provisioned for peak traffic sit idle the rest of the time. This increases cost without adding value.

This project uses serverless AWS services that scale automatically based on demand. Services used include:

  • • Amazon CloudFront
  • • AWS WAF
  • • Amazon API Gateway
  • • AWS Lambda
  • • Amazon DynamoDB

When traffic increases, these services scale to handle it. When traffic drops, they scale back down. You pay only for what runs.

This pattern applies to many workloads:

  • • public APIs
  • • serverless web applications
  • • SaaS backends
  • • webhook processing systems
  • • event-driven microservices
  • • IoT ingestion pipelines

AWS references:

Architecture

Architecture Diagram · Official AWS Icons

UsersHTTPS requestCloudFrontEdge cacheAWS WAFRate + rulesAPI GatewayREST / HTTPLambdaRedirect logicDynamoDBURL store
Request flow · Icons: AWS Architecture Icons (official)
View detailed architecture explanation

When a user visits a shortened link, the request first enters the AWS edge network through Amazon CloudFront. CloudFront distributes requests through global edge locations, improving latency and providing an additional security boundary.

AWS WAF inspects incoming requests and can block malicious traffic or enforce rate limiting policies.

Requests then pass to Amazon API Gateway, which exposes the serverless API responsible for resolving shortened URLs.

API Gateway triggers an AWS Lambda function that performs the redirect logic. The function retrieves the destination URL from Amazon DynamoDB using the short identifier as the lookup key.

DynamoDB provides fast key-value access with single-digit millisecond latency, making it well suited for redirect workloads that require extremely fast lookups.

AWS Well-Architected Framework Alignment

This architecture was designed following principles from the AWS Well-Architected Framework, which provides best practices for building secure, reliable, high-performing, and cost-efficient cloud systems.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html

Operational Excellence

The platform uses managed services and repeatable deployment workflows to reduce operational overhead while enabling continuous improvement.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/operational-excellence-pillar/welcome.html

Security

CloudFront and AWS WAF provide layered request filtering, while AWS IAM and managed service boundaries support least-privilege access control.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html

Reliability

The design relies on highly available managed services that can absorb sudden traffic surges and recover quickly from component-level disruptions.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/welcome.html

Performance Efficiency

Edge delivery through CloudFront and on-demand compute through Lambda keep latency low while matching capacity to workload demand.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/performance-efficiency-pillar/welcome.html

Cost Optimization

Consumption-based pricing across Lambda, API Gateway, and DynamoDB helps ensure that cost tracks actual usage, reducing waste during low-traffic periods.

Reference: https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html

Architecture diagram created using official AWS Architecture Icons. Reference: https://aws.amazon.com/architecture/icons/

Services Used

  • • Amazon API Gateway
  • • AWS Lambda
  • • Amazon DynamoDB
  • • Amazon CloudFront
  • • Amazon Route 53

Engineering Decisions

  • • Selected Lambda to avoid managing servers and handle burst traffic automatically.
  • • Placed CloudFront in front of API Gateway to reduce latency for global users.
  • • Used DynamoDB for predictable key-value lookups and horizontal scaling.

Tradeoffs

  • • Serverless simplifies operations but introduces cold-start considerations.
  • • Single-region DynamoDB is simpler but less resilient than multi-region options.

Lessons Learned

  • • Caching and TTL strategy has direct cost and performance impact.
  • • Observability dashboards are essential for tracking redirect reliability.