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