DEV Community

Cover image for How We Handle 50K QR Scans/Min for Riyadh Season: Redis + AWS Dammam + MOC Compliance
stampiq
stampiq

Posted on

How We Handle 50K QR Scans/Min for Riyadh Season: Redis + AWS Dammam + MOC Compliance

Your Lambda cold-starts during Maghrib prayer. 30,000 people hit your QR endpoint at once. Your US-East-1 Redis times out. MOC fines you 50K SAR.

This happened to us at KAFD, 2025. Here’s the architecture we use now for Riyadh Season 2026.

The Problem: Why Global Event Tools Fail in KSA

  1. Latency: us-east-1 → Riyadh = 120ms. During a QR scan you have 300ms total before users think it’s broken.
  2. PDPL: Saudi law = attendee PII must stay in-KSA. No S3 US buckets.
  3. MOC Audits: Officer walks to your booth 2pm. Asks for “Arabic VAT log for ticket #8492”. You have 60 sec.

Eventbrite, Hopin, Cvent all fail #2 and #3. So we rebuilt.

Architecture: Real-Time Event Analytics Dashboard at Scale

This runs NEOM, LEAP, and MDLBEAST. 1,200 scans/second sustained.

Component Choice KSA Reason
Compute AWS Dammam me-south-1 ECS Fargate PDPL compliant, 8ms Riyadh latency
Check-in API Node.js + Fastify 2ms p99. Validates QR HMAC in-memory
Real-time Redis Streams + WebSockets Sponsor gets “SABIC scanned booth” push <1s
Analytics ClickHouse 3-sec refresh for real-time event analytics dashboard
Compliance S3 Dammam + KMS Auto Arabic PDF invoice per ticket

Key Code: WhatsApp QR Rate Limiting
Meta blocks you at 1,000 msg/sec. We stay at 80/sec per number using BullMQ:


ts
import { Queue } from 'bullmq';

const whatsappQ = new Queue('wa', {
  connection: { host: 'dammam.redis.aws.com' } // PDPL safe
});

// Meta template must be pre-approved in Arabic
await whatsappQ.add('send-qr', {
  to: '+966501385001',
  template: 'riyadh_event_qr_v3_ar',
  vars: { name: 'Ahmed', seat: 'VIP-A12' }
}, { attempts: 5, backoff: { type: 'exponential', delay: 1000 } });
The “Event ROI Platform Saudi Arabia” Module
Sponsors don’t buy “impressions” anymore. At LEAP, Aramco paid 700K SAR for a booth. Their contract required:

Live pipeline value – We stream badge scans to their Salesforce. lead_value > 50K SAR = Slack alert.
Dwell time – Redis: SETEX booth:aramco:badge:123 900 1 → 15-min expiry = 15-min dwell.
MOC proof – 1-click export: SELECT * FROM checkins WHERE sponsor_id = 'aramco' COPY TO 's3://dammam-bucket/aramco.csv'
Result: 38M SAR pipeline tracked. They renewed 3 years. That’s why event roi platform saudi arabia is blowing up on Google.

3 Dev Gotchas for Saudi Event Registration
RTL Charts: Recharts breaks Arabic. Use Apache ECharts with direction: 'rtl'.
Offline First: KAFD basement = no signal. PWA + IndexedDB queue. Sync when online.
WhatsApp Templates: event_registration_riyadh_v2 gets rejected. Use riyadh_event_qr_v3 with {{1}} only for name. No marketing words.
Try It: Open Source MOC Checklist + Demo
We extracted the MOC/PDPL rules into a checklist we use before every Riyadh Season deploy: StampIQ

It covers: Dammam hosting, Arabic VAT, WhatsApp templates, audit logging. Same stack we use at KAFD.

Want the Meta-approved WhatsApp JSON + Terraform for Dammam setup? Contact us and say “Dev.to MOC”. My team sends it free.

Who else is building for KSA? Drop your stack below. If you’re stuck on Redis Streams latency or Arabic PDF generation, DM me. We’ve burned the 50K SAR so you don’t have to.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)