Coffee Shop
Full-Stack Serverless CRUD
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.
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
Client requests hit AWS CloudFront with Origin Access Control (OAC) and TLS 1.2 termination, routing static UI assets from S3.
REST operations route to AWS API Gateway HTTP APIs with CORS validation and route-level rate limiting.
Node.js 20 Lambda functions execute order validation and atomic state updates inside a minimal 512MB memory profile.
Transactions write to Amazon DynamoDB using conditioned put operations (`attribute_not_exists`) to prevent duplicate orders.
Architecture Decision Records (ADRs)
Failure-Mode & Resilience Analysis
Key Engineering Takeaways
- Single-table DynamoDB requires identifying 100% of read and write access patterns before writing any application code.
- Tree-shaking AWS SDK v3 client packages reduced Lambda package size from 38MB to 4.2MB, cutting cold starts by over 50%.
- API Gateway HTTP APIs provide significantly lower latency than REST APIs for lightweight microservices.
Empirical Benchmarks
Technology Primitives
- frontend
- React 19 + Vite
- backend
- Node.js 20 Lambda
- database
- DynamoDB (on-demand)
- infra
- Terraform + CloudFront + OAC
Architecture Tags
Public Live Demo · Detailed Architecture & Deploy Keys Secured. Operational lifecycle commands (Deploy, Scale, Destroy) and raw cloud credentials remain sealed in the private control plane.