Back to Case Study Catalog
⚡
Serverless · AWS
PUBLIC LIVE DEMOStatus: DEPLOYED (Running)

ABC1 Serverless Order Hub

Full-Stack Serverless Node.js 20 + DynamoDB

Execution Profile: Serverless On-Demand (Zero Idle Cost)
Cost Guardrail:< $0.20 / mo (Free Tier Optimized)

Problem Statement & Investigation

Traditional relational databases incur constant hourly costs even when traffic drops to zero overnight. For occasional and variable-traffic applications, an architectural model was required that scales to zero cost while delivering sub-20ms transactional writes.

Architectural Hypothesis

By organizing orders, customers, and inventory items into a single DynamoDB table using composite partition/sort keys, we can satisfy all primary access patterns within single-digit millisecond latency without running persistent database instances.

System Runtime Flow

11. Wildcard Edge Ingress

Client requests hit Cloudflare wildcard DNS (*.symmetriccloud.com) -> CloudFront CDN (d31o4mufv33k12.cloudfront.net) with CloudFront Function 2.0 rewriting host header to /demos/abc1/index.html in 0.4ms.

22. API Routing & Gateway

REST operations route to AWS API Gateway HTTP APIs with CORS validation and route-level rate limiting.

33. Compute Execution

Node.js 20 Lambda functions execute order validation and atomic state updates inside a minimal 512MB memory profile with sub-15ms warm invocation.

44. Atomic Persistence

Transactions write to Amazon DynamoDB using conditioned put operations (`attribute_not_exists`) to prevent duplicate orders.

Architecture Decision Records (ADRs)

ADR-001: CloudFront Function 2.0 Edge Subdomain RoutingACCEPTED
Decision: Use a sub-millisecond CloudFront Function to dynamically map *.symmetriccloud.com to S3 prefix /demos/<subdomain>/index.html.
Alternatives Evaluated: Dedicated CloudFront distributions per subdomain; ALB path-based routing.
Consequences: Zero added standing infrastructure costs per subdomain; 0.4ms overhead; wildcard TLS certificate integration.
ADR-002: Single-Table DynamoDB over Multi-TableACCEPTED
Decision: Store orders, customers, and inventory items in a single DynamoDB table with generic PK/SK attributes.
Alternatives Evaluated: Separate tables per entity; Amazon RDS PostgreSQL serverless.
Consequences: Eliminates multi-table scan joins; queries resolve in a single round-trip; requires strict key design adherence.
ADR-003: GitHub CI/CD Automation with AWS Deploy RunnerACCEPTED
Decision: Automate build and deployment directly from GitHub repository via GitHub Actions using repository secrets (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
Alternatives Evaluated: Manual S3 upload via console; CodePipeline.
Consequences: Zero manual steps; reproducible deployments on push to master.

Failure-Mode & Resilience Analysis

Scenario: DynamoDB Regional Throttling
Observed Behavior: Adaptive capacity absorbs sudden traffic spikes; on-demand billing mode auto-scales read/write request units instantaneously.
Architectural Mitigation: Exponential backoff with jitter implemented in AWS SDK v3 client configuration.
Scenario: High Concurrency Cold Starts
Observed Behavior: New execution environments take ~180ms to initialize on Node.js 20 before serving the first request.
Architectural Mitigation: Minimal dependency bundle tree-shaken with Vite/esbuild; keeps package size under 1.2MB.

Key Engineering Takeaways

  • CloudFront Function edge rewrites eliminate the need for costly separate CDN distributions for each subdomain.
  • Single-table DynamoDB requires front-loaded query design effort but delivers unwavering predictability at scale.
  • GitHub Actions deployment directly to S3 prefixes combined with instant CloudFront invalidation achieves <45s deploy cycle times.

Empirical Benchmarks

Edge Rewrite Latency0.4ms
CloudFront Function 2.0 URL rewrite execution time
p95 Write Latency14.2ms
End-to-end DynamoDB transaction write time
p95 Read Latency6.8ms
DynamoDB single-item key query resolution
Standing Idle Cost$0.00
Serverless compute and on-demand database cost at rest

Technology Primitives

frontend
React 19 + Vite
backend
Node.js 20 Lambda
database
DynamoDB (on-demand)
infra
Terraform + CloudFront + OAC

Architecture Tags

AWS LambdaDynamoDBAPI GatewayReact 19TerraformCloudFront
Security Notice

Active Live Subdomain · GitHub CI/CD Automated. Operational lifecycle commands (Deploy, Scale, Destroy) and raw cloud credentials remain sealed in the private control plane.