Complete Serverless Architecture
· 4 min · httptiger.com
Infrastructure Overview
HTTP Tiger runs entirely on AWS serverless infrastructure. The stack is built with the Serverless Framework, deploying Lambda functions behind API Gateway with DynamoDB for persistence.
Frontend: S3 + CloudFront (global CDN)
Backend: API Gateway → Lambda (Node.js 18.x) → DynamoDB
Auth: Google OAuth → JWT tokens
Secrets: AWS SSM Parameter Store
Payments: Stripe subscriptions
Rate Limiting with DynamoDB TTL
One interesting pattern we use is DynamoDB's TTL feature for rate limiting. Each request creates a record that auto-expires, so we never need cleanup jobs.
// Rate limit check - records auto-expire via DynamoDB TTL
const ttl = Math.floor(Date.now() / 1000) + 3600; // 1 hour
await dynamodb.put({
TableName: process.env.LIMITS_TABLE,
Item: { limitKey: `${userId}_${today}`, ttl },
ConditionExpression: 'attribute_not_exists(limitKey)'
}).promise();
Batch URL Processing
Checking hundreds of URLs requires careful concurrency control. We chunk requests by domain to avoid hammering any single server, with configurable delays between batches.
// Domain-aware batching prevents IP bans
const chunks = chunkByDomain(urls);
for (const chunk of chunks) {
const results = await Promise.allSettled(
chunk.map(url => checkUrl(url))
);
await delay(rateLimitMs);
}
Deployment
Single-command deployments via Serverless Framework. Infrastructure as code means every resource is version-controlled and reproducible across environments.
Key Decisions
- PAY_PER_REQUEST billing on DynamoDB - scales to zero cost when idle
- SSM Parameter Store for secrets - no env files, encrypted at rest
- Global Secondary Indexes for efficient user-scoped queries
- CloudWatch alarms on error rates and DynamoDB throttling