AWS Serverless QR Platform
· 3 min · qrcheetah.com
Architecture
React Frontend (S3/CloudFront)
↓
API Gateway + Lambda
↓
DynamoDB (metadata) + S3 (images)
QR Cheetah generates dynamic QR codes with analytics tracking. The platform handles generation, custom branding, scan tracking, and bulk operations - all serverless.
Cold Start Fix
Lambda cold starts were adding 2+ seconds to QR generation. Connection pooling outside the handler solved it.
// Reuse connections across invocations
let dynamoClient;
const getDynamoClient = () => {
if (!dynamoClient) {
dynamoClient = new AWS.DynamoDB.DocumentClient({
maxRetries: 3
});
}
return dynamoClient;
};
Scan Analytics
Dynamic QR codes point to a redirect endpoint that captures analytics before forwarding to the destination. The redirect Lambda records device info and geolocation, then returns a 302.
// Redirect with analytics capture
return {
statusCode: 302,
headers: {
Location: destinationUrl,
'Cache-Control': 'no-cache'
}
};
Performance
- QR generation: 200ms average
- Scan redirect: 50ms average
- Image delivery: CloudFront CDN with 1-year cache
- Cost: ~$0.01 per 100 QR codes