<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: stampiq</title>
    <description>The latest articles on DEV Community by stampiq (@stampiq).</description>
    <link>https://dev.to/stampiq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3789356%2F2e4cb9cc-9d7e-42c6-b5d1-c5fde950c3ac.jpg</url>
      <title>DEV Community: stampiq</title>
      <link>https://dev.to/stampiq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stampiq"/>
    <language>en</language>
    <item>
      <title>Building an Offline-First IoT Ingestion Pipeline with Go, SQLite WAL, and Redis Streams</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Fri, 16 Oct 2026 05:43:56 +0000</pubDate>
      <link>https://dev.to/stampiq/building-an-offline-first-iot-ingestion-pipeline-with-go-sqlite-wal-and-redis-streams-25cb</link>
      <guid>https://dev.to/stampiq/building-an-offline-first-iot-ingestion-pipeline-with-go-sqlite-wal-and-redis-streams-25cb</guid>
      <description>&lt;p&gt;When building IoT infrastructure for high-density environments, assuming you will have a stable internet connection is an architectural fatal flaw. &lt;/p&gt;

&lt;p&gt;At &lt;a href="https://stampiq.sa/" rel="noopener noreferrer"&gt;StampIQ&lt;/a&gt;, we engineer event analytics platforms for Saudi Vision 2030 mega-events. When 10,000 delegates flood a convention center within a 45-minute window, local cellular macrocells congest, and venue Wi-Fi packet loss spikes. &lt;/p&gt;

&lt;p&gt;If your physical hardware (like an RFID gate or a POS terminal) relies on a synchronous REST API call to a cloud PostgreSQL database to validate a payload, your hardware will freeze the moment the network degrades. &lt;/p&gt;

&lt;p&gt;To guarantee sub-5-millisecond hardware response times regardless of network health, we moved our persistence layer to the edge. Here is how we built an offline-first IoT ingestion pipeline using Go, SQLite Write-Ahead Logging (WAL), and Redis Streams.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Edge Node: Concurrency with SQLite WAL
&lt;/h2&gt;

&lt;p&gt;Each physical gate controller is an ARM-based edge node. Its primary job is to read passive UHF RFID tags (EPC Gen 2), validate the credential against a local manifest, and trigger a physical relay (opening a turnstile). &lt;/p&gt;

&lt;p&gt;This must happen locally. We use SQLite as our edge datastore, but standard SQLite locks the entire database during a write transaction. If a background sync thread is reading the database to push logs to the cloud, it will block the hardware from writing new RFID scans, freezing the gate.&lt;/p&gt;

&lt;p&gt;To fix this, we enable &lt;strong&gt;Write-Ahead Logging (WAL)&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;WAL mode decouples reads from writes. Writes are appended to a separate &lt;code&gt;-wal&lt;/code&gt; file, meaning readers do not block writers, and writers do not block readers. &lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
go
package main

import (
    "database/sql"
    "log"
    _ "[github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)"
)

func initEdgeDB() *sql.DB {
    // Open DB with WAL mode and memory-mapped I/O enabled via DSN pragmas
    db, err := sql.Open("sqlite3", "file:/var/data/edge_telemetry.db?cache=shared&amp;amp;mode=rwc&amp;amp;_journal_mode=WAL&amp;amp;_synchronous=NORMAL")
    if err != nil {
        log.Fatalf("Failed to open edge database: %v", err)
    }

    // Optimize for high-frequency micro-inserts
    db.Exec(`PRAGMA temp_store = MEMORY;`)
    db.Exec(`PRAGMA mmap_size = 268435456;`) // 256MB memory map

    // Create our telemetry buffer table
    db.Exec(`
        CREATE TABLE IF NOT EXISTS scan_buffer (
            id TEXT PRIMARY KEY,
            epc_hash TEXT NOT NULL,
            portal_id TEXT NOT NULL,
            epoch_ms INTEGER NOT NULL,
            synced INTEGER DEFAULT 0
        );
        CREATE INDEX IF NOT EXISTS idx_sync ON scan_buffer(synced);
    `)

    return db
}
With this configuration, the Go routine handling the RFID scanner can insert thousands of rows per second in under 2 milliseconds per transaction, completely unaffected by network status.

2. The Sync Daemon: Exponential Backoff
A separate Go goroutine acts as a synchronization daemon. It polls the SQLite database for unsynced records (WHERE synced = 0) and attempts to push them to the cloud.

If the venue network is down, the HTTP request fails, and the daemon simply backs off. The physical gate continues to operate normally, buffering the telemetry locally.

Go
func syncWorker(db *sql.DB) {
    for {
        // Extract up to 500 unsynced records
        rows, err := db.Query(`SELECT id, epc_hash, portal_id, epoch_ms FROM scan_buffer WHERE synced = 0 LIMIT 500`)
        if err != nil {
            time.Sleep(2 * time.Second)
            continue
        }

        payload := buildJSONPayload(rows)

        // Attempt to push to the cloud API
        resp, err := http.Post("[https://api.stampiq.sa/v1/telemetry/ingest](https://api.stampiq.sa/v1/telemetry/ingest)", "application/json", payload)

        if err == nil &amp;amp;&amp;amp; resp.StatusCode == 202 {
            // Success! Mark batch as synced locally
            markAsSynced(db, payload)
        } else {
            // Network failed. Back off and retry later.
            log.Println("Network degraded. Buffering telemetry at the edge.")
            time.Sleep(5 * time.Second)
        }
    }
}
3. Cloud Ingestion: Redis Streams for Burst Traffic
When the venue's network connectivity is finally restored, dozens of edge nodes will simultaneously flush thousands of buffered records to the cloud.

If we push this sudden burst directly into our primary relational database, we risk massive lock contention and CPU spikes. Instead, we use Redis Streams as an ultra-fast, in-memory ingestion buffer.

When the cloud API receives a batch payload, it maps the data and issues an XADD command. Redis Streams provide an immutable, append-only log with O(1) insertion time.

Go
func ingestHandler(w http.ResponseWriter, r *http.Request) {
    var batch TelemetryBatch
    json.NewDecoder(r.Body).Decode(&amp;amp;batch)

    pipe := rdb.Pipeline()
    for _, scan := range batch.Records {
        pipe.XAdd(ctx, &amp;amp;redis.XAddArgs{
            Stream: "stream:gate_telemetry",
            Values: map[string]interface{}{
                "epc":    scan.EPCHash,
                "portal": scan.PortalID,
                "ts":     scan.EpochMS,
            },
        })
    }

    // Execute the pipeline atomically
    if _, err := pipe.Exec(ctx); err != nil {
        http.Error(w, "Ingestion Failed", http.StatusInternalServerError)
        return
    }

    w.WriteHeader(http.StatusAccepted)
}
4. Downstream Processing
Once the data is safely buffered in Redis Streams, a cluster of backend consumer groups reads the stream at a controlled pace. They apply idempotent deduplication, update real-time venue capacity metrics, and finally write the settled data to TimescaleDB for long-term analytical storage.

The Takeaway
When engineering for the physical world, network failure is a feature, not a bug. By pushing relational persistence to the edge using SQLite WAL and utilizing Redis Streams to absorb burst ingestion, you can build IoT architectures that are virtually indestructible under load.

If you are interested in seeing how this architecture powers high-density crowd analytics and cashless payments, check out the engineering solutions at StampIQ.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>go</category>
      <category>architecture</category>
      <category>iot</category>
      <category>redis</category>
    </item>
    <item>
      <title>Processing 10k Concurrent RFID Payments at the Edge: Go, SQLite WAL, and EPC Gen 2</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Thu, 15 Oct 2026 06:04:28 +0000</pubDate>
      <link>https://dev.to/stampiq/processing-10k-concurrent-rfid-payments-at-the-edge-go-sqlite-wal-and-epc-gen-2-2cig</link>
      <guid>https://dev.to/stampiq/processing-10k-concurrent-rfid-payments-at-the-edge-go-sqlite-wal-and-epc-gen-2-2cig</guid>
      <description>&lt;p&gt;When engineering fintech and access control infrastructure for large-scale physical events, standard cloud architectures eventually hit a hard physical wall.&lt;/p&gt;

&lt;p&gt;Under the &lt;strong&gt;Saudi Vision 2030 events strategy&lt;/strong&gt;, mega-summits in Riyadh and Jeddah regularly process upwards of 10,000 delegates. At these scales, the operational realities of a crowded convention center break traditional web systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Saturated Networks:&lt;/strong&gt; As thousands of delegates stream through the doors, local cellular macrocells congest and venue Wi-Fi suffers catastrophic packet loss.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Concurrency Bursts:&lt;/strong&gt; 80% of gate traffic and 60% of food and beverage (F&amp;amp;B) purchases happen during narrow 30-to-45-minute windows (e.g., morning ingress and keynote breaks)[cite: 14].&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your &lt;strong&gt;event analytics platform&lt;/strong&gt; or POS system relies on a synchronous HTTP handshake to a remote PostgreSQL database to open a turnstile or process a payment, it will fail under burst load. &lt;/p&gt;

&lt;p&gt;To guarantee sub-second transaction times and zero gate downtime, we redesigned our &lt;strong&gt;RFID attendee tracking&lt;/strong&gt; and &lt;strong&gt;cashless event payments&lt;/strong&gt; architecture entirely around Edge Persistence and Dual-Frequency hardware.&lt;/p&gt;

&lt;p&gt;Here is how we built it.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Dual-Frequency Credentials (UHF + HF)
&lt;/h2&gt;

&lt;p&gt;The foundation of our architecture is a single physical smart credential (either a sub-3-second on-demand thermal badge or a durable silicone wristband).&lt;/p&gt;

&lt;p&gt;We abandoned optical QR codes entirely. Instead, each credential contains a dual-frequency inlay with two distinct memory chips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Passive UHF EPC Gen 2 (865–868 MHz):&lt;/strong&gt; Used strictly for zero-contact spatial tracking. Overhead RFID portals read these tags at distances up to 8 meters. Using dynamic Q-algorithm arbitration (Frame-Slotted ALOHA), a single portal can resolve up to 400 tag collisions per second, tracking venue capacity and sponsor dwell times without attendees ever breaking stride.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Near-Field HF (13.56 MHz / NFC):&lt;/strong&gt; Used for explicit intent actions, such as tapping to process a cashless payment at a vendor terminal or tapping to access a restricted ministerial VIP lounge.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Offline-First POS Architecture with SQLite WAL
&lt;/h2&gt;

&lt;p&gt;If a vendor's Point-of-Sale terminal has to query an external cloud API to verify a wristband's wallet balance, the F&amp;amp;B queue will grind to a halt the moment venue Wi-Fi drops.&lt;/p&gt;

&lt;p&gt;We pushed the financial ledger down to the edge. Each physical POS terminal and gate controller runs an embedded &lt;strong&gt;SQLite database in Write-Ahead Logging (WAL) mode&lt;/strong&gt;[cite: 14].&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
sql
-- POS Edge Node Initialization
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA temp_store = MEMORY;

-- Local Ledger Schema
CREATE TABLE IF NOT EXISTS edge_transactions (
    txn_id TEXT PRIMARY KEY,
    wallet_uid TEXT NOT NULL,
    vendor_id TEXT NOT NULL,
    amount INTEGER NOT NULL, -- Stored in base currency units (Halalas)
    epoch_ms INTEGER NOT NULL,
    sync_state INTEGER DEFAULT 0
);
Sub-Millisecond Tap-to-PayWhen a delegate taps their wristband to buy a coffee:The local NFC reader validates the cryptographically signed offline balance directly from the HF chip's secure memory sector.   

The transaction is appended to the local SQLite WAL companion file in under 4 milliseconds.   The physical UI updates instantly, completing the transaction.

A background Go daemon running on the terminal continuously monitors network health. When the internet connection is stable, it asynchronously flushes the committed transactions in batches to our central cloud API. If the internet drops, the terminal keeps selling.

3. Cloud Ingestion with Go &amp;amp; Redis StreamsTo handle the asynchronous telemetry bursts coming from hundreds of offline-resilient edge nodes, we use a Go-based ingestion layer backed by Redis Streams[cite: 14].Gopackage main

import (
    "context"
    "encoding/json"
    "net/http"
    "[github.com/redis/go-redis/v9](https://github.com/redis/go-redis/v9)"
)

var ctx = context.Background()
var rdb *redis.Client

type SyncBatch struct {
    Transactions []CashlessTxn `json:"transactions"`
}

func ingestEdgeBatch(w http.ResponseWriter, r *http.Request) {
    var batch SyncBatch
    if err := json.NewDecoder(r.Body).Decode(&amp;amp;batch); err != nil {
        http.Error(w, err.Error(), 400)
        return
    }

    pipe := rdb.Pipeline()
    for _, txn := range batch.Transactions {
        // Push to in-memory Redis Stream buffer
        pipe.XAdd(ctx, &amp;amp;redis.XAddArgs{
            Stream: "stream:cashless_ingestion",
            Values: map[string]interface{}{
                "txn_id": txn.TxnID,
                "wallet": txn.Wallet,
                "amount": txn.Amount,
                "vendor": txn.VendorID,
            },
        })
    }

    if _, err := pipe.Exec(ctx); err != nil {
        http.Error(w, "Ingestion Failed", 500)
        return
    }

    w.WriteHeader(http.StatusAccepted)
}
By pushing telemetry directly into an in-memory stream buffer, we completely decouple our primary PostgreSQL database from the extreme write contention caused by hardware synchronization bursts.4. Live Command via WebSocketsA worker pool consumes the Redis Streams, applies idempotent deduplication logic based on the txn_id, and computes rolling spatial and financial aggregations.

These metrics are then broadcasted via WebSockets directly to our KSA custom reporting dashboard. 

Event directors and financial controllers gain instant visibility into live vendor settlements, peak F&amp;amp;B purchasing windows, and civil defense hall capacities, all without aggressively polling the database.

ConclusionBuilding physical event technology requires acknowledging that venue networks will fail[cite: 1, 14]. By treating cloud connectivity as an eventual luxury rather than a strict requirement, we guarantee continuous ingress and revenue generation.

To explore how these architectures are deployed in the field across GCC exhibitions, review the hardware integration models behind StampIQ's cashless payments for events and their real-time event analytics platform.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>go</category>
      <category>sqlite</category>
      <category>fintech</category>
    </item>
    <item>
      <title>Architecting Zero-Latency RFID Attendee Tracking: Edge SQL and Go for High-Density Events</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Wed, 14 Oct 2026 06:40:19 +0000</pubDate>
      <link>https://dev.to/stampiq/architecting-zero-latency-rfid-attendee-tracking-edge-sql-and-go-for-high-density-events-gg9</link>
      <guid>https://dev.to/stampiq/architecting-zero-latency-rfid-attendee-tracking-edge-sql-and-go-for-high-density-events-gg9</guid>
      <description>&lt;p&gt;When building an &lt;strong&gt;event analytics platform&lt;/strong&gt; for Saudi Vision 2030 mega-events (like LEAP Riyadh or the Global AI Summit), standard web architecture paradigms completely break down[cite: 1, 14].&lt;/p&gt;

&lt;p&gt;If you build a typical gate access control system—where an optical scanner reads a QR code, sends an HTTP request to a remote PostgreSQL database, waits for validation, and opens a turnstile—you will fail in production[cite: 1]. &lt;/p&gt;

&lt;p&gt;Why? Because when 8,000 delegates enter a convention center in Riyadh between 8:15 AM and 9:00 AM, the venue’s commercial fiber connection and local 5G macrocells instantly saturate. Your 150ms HTTP handshake balloons to 8 seconds, and your physical gates freeze.&lt;/p&gt;

&lt;p&gt;To achieve zero-latency entry and continuous crowd flow, we redesigned our &lt;strong&gt;RFID attendee tracking&lt;/strong&gt; architecture around two principles: &lt;strong&gt;Offline-First Edge Persistence&lt;/strong&gt; and &lt;strong&gt;Passive UHF Telemetry&lt;/strong&gt;[cite: 1, 14].&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Ditching Barcodes for Passive UHF Telemetry
&lt;/h2&gt;

&lt;p&gt;Optical scanners require line-of-sight, which limits gate throughput to roughly 10 delegates per minute per lane. To process enterprise crowds, we moved to passive Ultra-High Frequency (UHF) radio telemetry.&lt;/p&gt;

&lt;p&gt;Instead of a phone screen, attendees are issued a smart badge encoded with an EPC Gen 2 (ISO 18000-6C) microchip. We place overhead RFID portals across the venue archways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Physics of Anti-Collision:&lt;/strong&gt;&lt;br&gt;
When a group of 15 attendees walks through a portal simultaneously, their backscattered radio signals collide. To resolve this, our edge readers use dynamic Q-algorithm arbitration (Frame-Slotted ALOHA):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The reader broadcasts a slot parameter $Q$.&lt;/li&gt;
&lt;li&gt;Tags randomly select a slot $C = 2^Q$. &lt;/li&gt;
&lt;li&gt;If tags collide in the same slot, the reader increments $Q$ to expand the slot pool for the next millisecond round.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allows a single overhead portal to resolve up to &lt;strong&gt;400 distinct tag reads per second&lt;/strong&gt;—capturing precise zone access and sponsor dwell times without anyone ever stopping to scan.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Offline-First Edge Resilience (SQLite WAL)
&lt;/h2&gt;

&lt;p&gt;When the reader successfully decodes an EPC payload, it passes the binary frame to a local industrial edge controller (e.g., an ARM-based SBC running Linux). This controller &lt;em&gt;must not&lt;/em&gt; wait for a cloud HTTP response to grant access.&lt;/p&gt;

&lt;p&gt;Instead, we run a localized admission engine using &lt;strong&gt;SQLite in Write-Ahead Logging (WAL) mode&lt;/strong&gt;[cite: 14].&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
// Local Node.js Edge Runtime (Simplified)
const Database = require('better-sqlite3');

const db = new Database('/var/data/gate_telemetry.db');

// WAL decouples reads from writes, preventing thread locks
db.pragma('journal_mode = WAL');
db.pragma('synchronous = NORMAL');
db.pragma('temp_store = MEMORY');

// Pre-load the expected attendee manifest into memory-mapped pages
const validateScan = db.prepare(`
  SELECT delegate_uuid, access_level 
  FROM local_manifest 
  WHERE epc_hash = ?
`);

const logEntry = db.prepare(`
  INSERT INTO telemetry_buffer (epc_hash, portal_id, direction, epoch_ms, synced)
  VALUES (?, ?, ?, ?, 0)
`);

function processRFIDFrame(frame) {
  // 1. Local sub-millisecond lookup
  const delegate = validateScan.get(frame.epc_hash);

  if (delegate &amp;amp;&amp;amp; delegate.access_level &amp;gt;= REQUIRED_LEVEL) {
    // 2. Fire physical relay (turnstile/light) instantly
    hardwareRelay.open();

    // 3. Commit to local buffer (avg ~2ms write time)
    logEntry.run(frame.epc_hash, frame.portal_id, frame.direction, Date.now());
  }
}
Because SQLite WAL allows concurrent readers and writers, the continuous influx of RFID reads never blocks the background daemon, which is responsible for syncing data back to the cloud.

3. High-Throughput Cloud Ingestion (Go &amp;amp; Redis)
When the venue's wide-area network is stable, edge nodes continuously flush their local telemetry_buffer to our central cloud API.

To handle bursts of telemetry from dozens of portals simultaneously without overwhelming our relational database, our cloud ingestion layer is written in Go and buffers directly into Redis Streams[cite: 14].

Go
package main

import (
    "context"
    "encoding/binary"
    "net/http"
    "[github.com/redis/go-redis/v9](https://github.com/redis/go-redis/v9)"
)

var ctx = context.Background()
var rdb *redis.Client

func ingestTelemetryBatch(w http.ResponseWriter, r *http.Request) {
    // Parse compacted binary batch from edge node
    batch := parseBinaryPayload(r.Body)

    pipe := rdb.Pipeline()
    for _, scan := range batch {
        // Append to immutable stream buffer O(1)
        pipe.XAdd(ctx, &amp;amp;redis.XAddArgs{
            Stream: "stream:rfid_ingress",
            Values: map[string]interface{}{
                "epc":    scan.EPC,
                "portal": scan.PortalID,
                "ts":     scan.EpochMS,
            },
        })
    }

    if _, err := pipe.Exec(ctx); err != nil {
        http.Error(w, "Ingestion Failed", 500)
        return
    }

    w.WriteHeader(http.StatusAccepted)
}
4. Powering the Live Dashboard
A cluster of Go worker nodes consumes the stream:rfid_ingress via Redis Consumer Groups[cite: 14]. These workers apply deduplication logic, aggregate spatial headcounts, and push the live metrics via WebSockets directly to the operations team's KSA custom reporting dashboard[cite: 14].

This architecture provides event directors with real-time visibility into gate influx velocity and civil defense hall capacities, while guaranteeing that physical ingress never halts[cite: 14].

Engineering for Physical Scale
If you are building IoT telemetry pipelines or developing access control software, remember: physical hardware cannot wait on the cloud[cite: 14].

By pushing persistence to the edge with SQLite WAL and decoupling cloud ingestion with Redis Streams, you can build event infrastructure that scales effortlessly to tens of thousands of users[cite: 14]. To see these systems in production, check out StampIQ's event technology deployments across the GCC.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>go</category>
      <category>sqlite</category>
      <category>iot</category>
    </item>
    <item>
      <title>Building a High-Throughput Cashless Payment &amp; RFID Ticketing System for Saudi Mega-Events</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Tue, 13 Oct 2026 06:11:29 +0000</pubDate>
      <link>https://dev.to/stampiq/building-a-high-throughput-cashless-payment-rfid-ticketing-system-for-saudi-mega-events-40i4</link>
      <guid>https://dev.to/stampiq/building-a-high-throughput-cashless-payment-rfid-ticketing-system-for-saudi-mega-events-40i4</guid>
      <description>&lt;p&gt;When engineering the infrastructure for an &lt;strong&gt;event ticketing and management system in Saudi Arabia&lt;/strong&gt;, the physical reality of the venue dictates the software architecture.&lt;/p&gt;

&lt;p&gt;Under the &lt;strong&gt;Saudi Vision 2030 events strategy&lt;/strong&gt;, mega-summits in Riyadh and Jeddah frequently process upwards of 10,000 delegates. These environments are hostile to standard cloud-dependent web applications:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Network Saturation:&lt;/strong&gt; Cellular towers congest and venue Wi-Fi degrades under massive attendee density.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Fragmented Stacks:&lt;/strong&gt; Venues traditionally run three isolated systems—one API for ticketing, a separate local database for gate turnstiles, and independent POS terminals for food/merchandise.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;High Concurrency Peaks:&lt;/strong&gt; 80% of gate entries and 60% of F&amp;amp;B purchases happen in tight 30-to-45-minute windows (e.g., morning ingress and keynote breaks).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To eliminate venue queues and financial reconciliation errors, we built a unified, edge-resilient architecture that merges secure ticketing, &lt;strong&gt;RFID attendee tracking&lt;/strong&gt;, and &lt;strong&gt;cashless event payments&lt;/strong&gt; into a single cryptographic smart credential.&lt;/p&gt;

&lt;p&gt;Here is how we architected the system to guarantee sub-second gate scans and offline-resilient financial transactions.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Unified Credential: UHF RFID + NFC
&lt;/h2&gt;

&lt;p&gt;Instead of relying on fragile optical QR codes that require line-of-sight scanning, the foundation of the system is a physical smart badge or &lt;strong&gt;RFID wristband&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;When a delegate arrives, their digital ticket triggers an on-demand thermal print cycle (sub-3 seconds). Simultaneously, an integrated encoder writes an encrypted payload to a dual-frequency inlay:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;UHF EPC Gen 2 (865–868 MHz):&lt;/strong&gt; Used for passive, zero-contact spatial tracking. Overhead portals read these tags at distances up to 8 meters to monitor civil defense hall capacities and VIP dwell times without requiring the user to stop.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;HF NFC (13.56 MHz / ISO 14443):&lt;/strong&gt; Used for deliberate, secure intent actions—specifically, tapping to pay at a vendor terminal or tapping to open a restricted ministerial lounge door.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Edge-First Gate &amp;amp; POS Architecture (SQLite WAL)
&lt;/h2&gt;

&lt;p&gt;If a vendor's Point-of-Sale (POS) terminal requires a round-trip HTTP request to a cloud server to verify a wristband's wallet balance, the transaction will inevitably fail when venue Wi-Fi drops.&lt;/p&gt;

&lt;p&gt;To achieve guaranteed sub-second tap-to-pay transactions, we decoupled the physical read layer from the wide-area network. Both our gate controllers and vendor POS devices act as autonomous edge nodes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Persistence with Write-Ahead Logging
&lt;/h3&gt;

&lt;p&gt;Each edge terminal runs an embedded SQLite database configured for high-concurrency appends:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
sql
-- POS Edge Node Initialization
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA temp_store = MEMORY;

CREATE TABLE IF NOT EXISTS local_transactions (
    txn_id TEXT PRIMARY KEY,
    wallet_uid TEXT NOT NULL,
    vendor_id TEXT NOT NULL,
    amount INTEGER NOT NULL, -- Stored in base currency units (Halalas)
    epoch_ms INTEGER NOT NULL,
    sync_state INTEGER DEFAULT 0
);
When an attendee taps their wristband to purchase a coffee, the NFC reader validates the cryptographically signed wallet balance directly from the chip's secure memory sector. 

The ledger deduction is written to the local SQLite WAL companion file in under 4 milliseconds.

A background Go daemon continuously monitors network health and asynchronously flushes committed transactions to the central cloud API when connectivity permits.

3. High-Throughput Ingestion Pipeline (Go &amp;amp; Redis)When network connectivity is stable, hundreds of edge portals and POS terminals continuously stream telemetry and financial ledgers to the central cloud.

To prevent our primary PostgreSQL relational database from locking under heavy concurrent writes, we use Redis Streams as a high-speed ingestion buffer.   Our Go ingestion gateway handles incoming TCP payloads and pushes them to Redis in memory:Gopackage main

import (
    "context"
    "encoding/json"
    "log"
    "net/http"
    "[github.com/redis/go-redis/v9](https://github.com/redis/go-redis/v9)"
)

var ctx = context.Background()
var rdb *redis.Client

type CashlessTxn struct {
    TxnID    string `json:"txn_id"`
    Wallet   string `json:"wallet"`
    Amount   int    `json:"amount"` // Halalas
    VendorID string `json:"vendor_id"`
    EpochMS  int64  `json:"epoch"`
}

func ingestTransaction(w http.ResponseWriter, r *http.Request) {
    var txn CashlessTxn
    if err := json.NewDecoder(r.Body).Decode(&amp;amp;txn); err != nil {
        http.Error(w, err.Error(), http.StatusBadRequest)
        return
    }

    // Push to in-memory Redis Stream buffer
    err := rdb.XAdd(ctx, &amp;amp;redis.XAddArgs{
        Stream: "stream:cashless_transactions",
        Values: map[string]interface{}{
            "txn_id": txn.TxnID,
            "wallet": txn.Wallet,
            "amount": txn.Amount,
            "vendor": txn.VendorID,
            "epoch":  txn.EpochMS,
        },
    }).Err()

    if err != nil {
        http.Error(w, "Ingestion Failed", http.StatusInternalServerError)
        return
    }

    w.WriteHeader(http.StatusAccepted)
}
4. Live Financial &amp;amp; Spatial Command DashboardsA worker pool consumes the Redis Streams, applying deduplication (based on TxnID) and writing the settled records to TimescaleDB for permanent storage.

Simultaneously, the workers compute rolling 60-second aggregations and broadcast them via WebSockets to our KSA custom reporting dashboards.

This provides event operations teams with real-time, actionable intelligence:Live Vendor Settlements: Financial controllers can monitor live POS revenue across the entire exhibition floor, tracking exact spending velocity without waiting for end-of-day batch processing.

Civil Defense Density Adherence: Security teams receive immediate alerts if passive UHF portals detect that a specific keynote hall is nearing its municipal capacity limit.

Architecting for Scale in the GCCBy unifying ticketing, spatial tracking, and digital wallets into a single edge-resilient architecture, we eliminate the physical queues and data silos that plague legacy event operations.

If you are developing solutions for physical venues or exploring hardware-integrated fintech, review the deployment models powering StampIQ's cashless payments for events and their enterprise event registration platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>go</category>
      <category>websockets</category>
      <category>fintech</category>
    </item>
    <item>
      <title>Ingesting 10,000 RFID Scans/Sec: Edge-First Event Telemetry with Go, Redis Streams, and WebSockets</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Mon, 12 Oct 2026 05:32:33 +0000</pubDate>
      <link>https://dev.to/stampiq/ingesting-10000-rfid-scanssec-edge-first-event-telemetry-with-go-redis-streams-and-websockets-4p79</link>
      <guid>https://dev.to/stampiq/ingesting-10000-rfid-scanssec-edge-first-event-telemetry-with-go-redis-streams-and-websockets-4p79</guid>
      <description>&lt;p&gt;During high-density international summits and industrial exhibitions in Riyadh and Jeddah, arrival traffic clusters heavily: up to 80% of delegates enter through security turnstiles within a narrow 45-minute window.&lt;/p&gt;

&lt;p&gt;When 10,000+ delegates pass through RFID turnstiles and overhead scanning portals simultaneously, traditional architectures fail[cite: 12]:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public WAN Degradation:&lt;/strong&gt; Conventional cellular towers and venue Wi-Fi access points saturate, causing remote cloud REST API latencies to spike from 150ms to over 5,000ms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Write Contention:&lt;/strong&gt; Concurrent relational inserts lock tables, stalling turnstile relays and backing up gate lines into exterior corridors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard Desynchronization:&lt;/strong&gt; Polling-based administration screens crash under HTTP connection overhead, leaving operations teams blind to live hall occupancy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To maintain an ingress pace below 3 seconds per attendee, telemetry ingestion must be decoupled from remote cloud infrastructure and relational database transactions. &lt;/p&gt;

&lt;p&gt;Here is the operational blueprint for an edge-first, high-throughput event analytics pipeline capable of ingesting passive UHF radio telemetry, computing real-time spatial densities, and streaming live updates to operational dashboards.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Topology
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ┌─────────────────────────┐       ┌─────────────────────────┐│  Overhead UHF Portals   │       │   High-Speed Turnstile  ││  (Passive EPC Gen 2)    │       │    (NFC / Smart Badge)  │└────────────┬────────────┘       └────────────┬────────────┘│                                 │▼                                 ▼[ Edge TCP/MQTT Broker (Binary Buffer Payloads) ]│▼[ Go High-Throughput Gateway ]│▼[ Redis Streams (In-Memory WAL) ]│┌──────────────┴──────────────┐▼                             ▼[ Stream Consumer Group ]     &lt;a href="https://dev.toSliding%20Window%20Aggregation"&gt; Pub/Sub Broadcaster &lt;/a&gt;   (WebSocket Push Server)│                             │▼                             ▼[ Cold WAL Storage / TimescaleDB ]   [ Operations Command Console ]
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Edge Gate Protocol: Compact Binary Payloads
&lt;/h2&gt;

&lt;p&gt;Avoid JSON over HTTP at physical entry points. Serializing verbose strings across hundreds of antennas consumes unnecessary gateway compute and introduces garbage collection delays on embedded controllers.&lt;/p&gt;

&lt;p&gt;Edge nodes package tag interrogations into fixed 16-byte binary frames sent over persistent TCP sockets:&lt;/p&gt;

&lt;h2&gt;
  
  
  ┌──────────────────┬──────────────────┬──────────────┬──────────────┐│  Epoch Timestamp │   Tag EPC Hash   │  Portal ID   │  Direction   ││     (4 Bytes)    │     (8 Bytes)    │   (2 Bytes)  │   (2 Bytes)  │└──────────────────┴──────────────────┴──────────────┴──────────────┘
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. Ingestion Engine: Non-Blocking Gateway in Go
&lt;/h2&gt;

&lt;p&gt;The Go ingestion service handles raw TCP frames from edge readers and appends them directly into &lt;strong&gt;Redis Streams&lt;/strong&gt; via memory pipelining:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
go
package main

import (
    "context"
    "encoding/binary"
    "io"
    "log"
    "net"
    "[github.com/redis/go-redis/v9](https://github.com/redis/go-redis/v9)"
)

var ctx = context.Background()
var rdb *redis.Client

type TelemetryFrame struct {
    Timestamp uint32
    TagHash   uint64
    PortalID  uint16
    Direction uint16 // 0x01 = IN, 0x02 = OUT
}

func handleConnection(conn net.Conn) {
    defer conn.Close()
    buf := make([]byte, 16)

    for {
        _, err := io.ReadFull(conn, buf)
        if err != nil {
            return
        }

        frame := TelemetryFrame{
            Timestamp: binary.BigEndian.Uint32(buf[0:4]),
            TagHash:   binary.BigEndian.Uint64(buf),
            PortalID:  binary.BigEndian.Uint16(buf),
            Direction: binary.BigEndian.Uint16(buf),
        }

        // Push to in-memory stream buffer
        err = rdb.XAdd(ctx, &amp;amp;redis.XAddArgs{
            Stream: "stream:event_telemetry",
            Values: map[string]interface{}{
                "ts":       frame.Timestamp,
                "tag":      frame.TagHash,
                "portal":   frame.PortalID,
                "dir":      frame.Direction,
            },
        }).Err()

        if err != nil {
            log.Printf("Stream ingestion failure: %v", err)
        }
    }
}

func main() {
    rdb = redis.NewClient(&amp;amp;redis.Options{
        Addr: "localhost:6379",
    })

    listener, err := net.Listen("tcp", ":9000")
    if err != nil {
        log.Fatalf("Socket binding failed: %v", err)
    }
    defer listener.Close()

    for {
        conn, err := listener.Accept()
        if err != nil {
            continue
        }
        go handleConnection(conn)
    }
}
3. Real-Time Telemetry Processing &amp;amp; AggregationDisplaying raw logs is insufficient for venue directors. Incident response teams require rolling metrics:Gate Influx Velocity: Entries per lane per minute.   Active Room Density: Current occupancy compared against Civil Defense safety thresholds.   A worker pool consumes the stream using Redis Consumer Groups and aggregates metrics within 60-second sliding windows:JavaScript// aggregation_worker.js
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);

async function processTelemetry() {
  const entries = await redis.xreadgroup(
    'GROUP', 'telemetry_processors', 'worker_alpha',
    'COUNT', '500',
    'BLOCK', '1000',
    'STREAMS', 'stream:event_telemetry', '&amp;gt;'
  );

  if (!entries || !entries.length) return;

  const [stream, messages] = entries[0];
  const pipe = redis.pipeline();

  for (const [id, fields] of messages) {
    const payload = Object.fromEntries(
      fields.reduce((acc, cur, i) =&amp;gt; (i % 2 === 0 ? acc.push([cur, fields[i + 1]]) : null, acc), [])
    );

    const delta = payload.dir === '1' ? 1 : -1;
    const hallKey = `occupancy:hall:${payload.portal}`;
    const rateKey = `rate:gate:${payload.portal}:${Math.floor(Date.now() / 60000)}`;

    // Update spatial totals
    pipe.incrby(hallKey, delta);
    pipe.incr(rateKey);
    pipe.expire(rateKey, 3600); // 1-hour rolling window

    // Acknowledge read in stream
    pipe.xack('stream:event_telemetry', 'telemetry_processors', id);
  }

  await pipe.exec();
}
4. Live Command Broadcasting via WebSocketsTo avoid overwhelming databases with repetitive dashboard polling, metrics are pushed to client sessions through WebSockets using Redis Pub/Sub:JavaScript// websocket_broadcaster.js
import { WebSocketServer } from 'ws';
import Redis from 'ioredis';

const redis = new Redis();
const wss = new WebSocketServer({ port: 8080 });

redis.subscribe('channel:telemetry_updates', (err) =&amp;gt; {
  if (!err) console.log('Broadcaster active on telemetry channel.');
});

redis.on('message', (channel, message) =&amp;gt; {
  wss.clients.forEach((client) =&amp;gt; {
    if (client.readyState === 1) { // WebSocket.OPEN
      client.send(message);
    }
  });
});
Operational Safeguards for GCC VenuesDeploying physical technology in high-profile event environments requires planning for physical and network failures.
Embedded SQLite WAL Buffers: In the event of a total network disconnect, gate kiosks commit transactions to local SQLite instances using Write-Ahead Logging (WAL). 
Scans commit in under 5ms, batching records to cloud storage only after WAN connections recover.
Passive Overhead Portals: Portals running EPC Gen 2 anti-collision protocols resolve up to 400 tag backscatters per second, capturing transit metrics without manual badge taps.

Auditable Dwell Analytics: Spatial telemetry registers entrance and exit timestamps automatically, supplying sponsors with verified engagement and dwell figures.

To see this telemetry architecture in production, review our deployment post-mortem on the Humain Leap Saudi event accreditation case study or inspect StampIQ's real-time event analytics dashboard engineered for regional enterprise venues.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>go</category>
      <category>redis</category>
      <category>websockets</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why Cloud-First Event Check-ins Fail at 10k Scale And How We Built an Edge-First Alternative</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Fri, 09 Oct 2026 05:52:03 +0000</pubDate>
      <link>https://dev.to/stampiq/why-cloud-first-event-check-ins-fail-at-10k-scale-and-how-we-built-an-edge-first-alternative-20l8</link>
      <guid>https://dev.to/stampiq/why-cloud-first-event-check-ins-fail-at-10k-scale-and-how-we-built-an-edge-first-alternative-20l8</guid>
      <description>&lt;p&gt;If you have ever built an event registration or ticketing app, the default architecture usually looks clean on paper:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Attendee shows a QR code on their phone.&lt;/li&gt;
&lt;li&gt;A scanner app hits a cloud REST API (&lt;code&gt;POST /api/v1/checkin&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;An auth token is verified, PostgreSQL flips &lt;code&gt;checked_in = true&lt;/code&gt;, and a 200 OK returns.&lt;/li&gt;
&lt;li&gt;Total round-trip time: ~180ms.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In staging, this works flawlessly. Even with synthetic loads of 500 req/sec across a few load balancers, everything stays green.&lt;/p&gt;

&lt;p&gt;Then production happens at an enterprise expo center in Riyadh.&lt;/p&gt;

&lt;p&gt;Within 40 minutes, 8,000 attendees arrive at once. Local cellular towers saturate instantly. The venue’s commercial fiber drops from 300 Mbps down to intermittent 2 Mbps bursts. Latency shoots from 180ms to 9 seconds, gateways start returning &lt;code&gt;504 Gateway Timeout&lt;/code&gt;, turnstiles stop opening, and the physical line stretches out the entrance.&lt;/p&gt;

&lt;p&gt;Here is an architectural post-mortem on why cloud-first check-in fails under burst concurrency, and how we redesigned the physical gate stack around &lt;strong&gt;local edge nodes, SQLite WAL journaling, and passive UHF radio telemetry&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Failure Mode: Synchronous Cloud Dependency
&lt;/h2&gt;

&lt;p&gt;When physical gate hardware waits on a network handshake before actuating a barrier or firing a thermal print head, network latency dictates your physical throughput.&lt;/p&gt;

&lt;p&gt;Consider the math:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At &lt;strong&gt;200ms per scan&lt;/strong&gt;, a single lane processes ~5 delegates per minute (ignoring human movement).&lt;/li&gt;
&lt;li&gt;At &lt;strong&gt;3,000ms latency&lt;/strong&gt; (common when 4G/5G degrades under crowd density), that lane drops to fewer than 1.5 delegates per minute.&lt;/li&gt;
&lt;li&gt;With 20 lanes and 6,000 delegates arriving between 8:15 AM and 8:45 AM, a queue of 2,000+ people forms within 12 minutes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To guarantee zero wait time, the gate controller must &lt;strong&gt;never&lt;/strong&gt; make a blocking remote network call during the transaction. The admission decision must happen strictly on local hardware in under 10 milliseconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Edge Node: SQLite with Write-Ahead Logging (WAL)
&lt;/h2&gt;

&lt;p&gt;Instead of thin clients polling a central DB, each gate lane runs a hardened Linux edge controller (e.g., an industrial SBC or embedded mini-PC) connected directly via RS-232/Ethernet to the thermal printer and RFID reader.&lt;/p&gt;

&lt;p&gt;The local datastore is SQLite, configured specifically for concurrent high-throughput append operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why SQLite WAL Mode?
&lt;/h3&gt;

&lt;p&gt;By default, standard SQLite locks the database file on write transactions. When multiple processes (the QR scanner thread, the RFID reader daemon, and the background cloud sync worker) hit the database concurrently, rollback journals create thread locks.&lt;/p&gt;

&lt;p&gt;Switching to &lt;code&gt;WAL&lt;/code&gt; (Write-Ahead Logging) decouples reads from writes entirely:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
sql
-- Edge node database initialization
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA cache_size = -32000; -- 32MB in-memory page cache
PRAGMA temp_store = MEMORY;

CREATE TABLE IF NOT EXISTS gate_transactions (
    id TEXT PRIMARY KEY,
    delegate_uuid TEXT NOT NULL,
    portal_id TEXT NOT NULL,
    credential_uid TEXT NOT NULL,
    scanned_at INTEGER NOT NULL,
    synced INTEGER DEFAULT 0
);

CREATE INDEX IF NOT EXISTS idx_sync_state ON gate_transactions(synced);
In WAL mode, writes append sequentially to the -wal companion file. 

Scans commit in less than 4ms, readers don't block writers, and writes don't block readers. 

Even if the venue power plug is pulled mid-write, SQLite recovery leaves the database fully consistent without corruption.   

3. Sub-3-Second Physical Credentials: EPC Gen 2 EncodingFor high-profile conferences, pre-printing thousands of badges beforehand creates logistical chaos: lost passes, last-minute VIP title edits, and human sorting delays.   

The fix is on-demand thermal issuance with concurrent RFID encoding:   [ Delegate Scans QR Pass ]
           │
           ▼
[ Local Edge SQLite Check (3ms) ] ──► Authorized
           │
     ┌─────┴─────────────────────────────────────┐
     ▼                                           ▼
[ Direct Thermal Print Head ]        [ Near-Field UHF Antenna ]
Renders badge canvas (300 DPI)       Encodes 96-bit EPC Gen 2 memory
           │                                     │
           └──────────────────┬──────────────────┘
                              ▼
           Badge ejected in &amp;lt; 2.8 seconds
As the thermal print engine feeds badge stock, a near-field UHF antenna programs the chip's EPC memory bank with an encrypted, cryptographically signed token. The chip’s factory TID (Tag Identifier) is married to the attendee record locally.   

This guarantees: No two delegates can share or duplicate physical passes.   The entire physical credential is created, written, and validated in under 3 seconds.   

4. Passive Telemetry: Replacing Manual Door Scans with UHF PortalsManual barcode scans at interior session doors create secondary queues outside keynote halls. If a session has 1,200 attendees, scanning each badge manually takes at least 15 minutes.   

To eliminate this, we deploy passive Ultra-High Frequency (UHF) overhead portals operating between 865–868 MHz (GCC band standards)[cite: 7, 12].                     ┌──────────────────────────────┐
                     │  Overhead UHF Portal Array   │
                     └──────────────┬───────────────┘
                                    │
               ┌────────────────────┴────────────────────┐
               ▼                                         ▼
      [ Polarized Beam: Zone A ]                [ Polarized Beam: Zone B ]
               │                                         │
    ┌──────────┴──────────┐                   ┌──────────┴──────────┐
    ▼                     ▼                   ▼                     ▼
[ Delegate 1 ]      [ Delegate 2 ]      [ Delegate 3 ]      [ Delegate 4 ]
(UHF Smart Badge)   (UHF Smart Badge)   (UHF Smart Badge)   (UHF Smart Badge)

Passive RF Backscatter: High-gain directional antennas broadcast an RF field across portal openings. As attendees walk naturally through the archway, passive inlays inside their badges harvest the RF energy, wake up, and backscatter their unique UID up to 8 meters away.   

Anti-Collision Framing: Using standard dynamic Q-algorithm arbitration (ISO 18000-6C), the portal interrogator resolves up to 400 distinct tag IDs per second simultaneously[cite: 12].

Automated Dwell Time Extraction: By recording exact entry and exit timestamps, we calculate genuine session attendance and sponsor booth dwell times without requiring attendees to stop[cite: 7, 12].

5. Event Telemetry &amp;amp; Conflict-Free Cloud SynchronizationWhen network connectivity drops, gates must keep working[cite: 12]. 

When connectivity restores, thousands of offline transactions must merge cleanly without primary key collisions or state overwrites[cite: 12].

We handle synchronization using a lightweight daemon running an exponential backoff loop:JavaScript// edge_sync_daemon.js
import Database from 'better-sqlite3';
import axios from 'axios';

const db = new Database('/var/data/gate_edge.db');

async function syncPendingRecords() {
  // Extract unsynced logs in small batches
  const unsynced = db.prepare(`
    SELECT id, delegate_uuid, portal_id, credential_uid, scanned_at 
    FROM gate_transactions 
    WHERE synced = 0 
    ORDER BY scanned_at ASC 
    LIMIT 200
  `).all();

  if (unsynced.length === 0) return;

  try {
    const res = await axios.post('[https://api.stampiq.sa/v1/telemetry/ingest](https://api.stampiq.sa/v1/telemetry/ingest)', {
      batch: unsynced,
      node_id: process.env.EDGE_NODE_ID
    }, { timeout: 4000 });

    if (res.status === 200) {
      const ids = unsynced.map(r =&amp;gt; `'${r.id}'`).join(',');
      db.prepare(`UPDATE gate_transactions SET synced = 1 WHERE id IN (${ids})`).run();
    }
  } catch (err) {
    // Graceful silent fail: edge node keeps scanning locally
    console.warn(`[Sync] Uplink degraded (${err.code || err.message}). Buffering locally.`);
  }
}

// Polling interval decoupled from hardware scan threads
setInterval(syncPendingRecords, 3000);

Deterministic State MergingIdempotent Ingestion: The cloud ingestion endpoint enforces unique constraints on (delegate_uuid, portal_id, scanned_at). 

Duplicate delivery from retry timeouts is safely discarded.Timestamp Priority: Every transaction uses monotonic POSIX millisecond timestamps generated at the hardware read layer, eliminating server-side clock skew ambiguities.

Key TakeawaysPhysical hardware must never wait on cloud round-trips. Network degradation during high-density crowd ingress is a certainty, not an edge case[cite: 12].

Local edge persistence is essential. SQLite with WAL journaling provides ACID safety, microscopic write latency, and zero thread contention[cite: 12].

Passive radio protocols eliminate human choke points. Replacing barcode scans with passive UHF portals increases gate throughput by an order of magnitude[cite: 7, 12].

If you are designing high-concurrency event hardware or looking at field implementations in the GCC, you can check out how we architected this for the Humain Leap deployment at StampIQ.   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>database</category>
      <category>iot</category>
      <category>performance</category>
    </item>
    <item>
      <title>Real-Time Event Telemetry: Ingesting 10k Scans/Sec with WebSockets &amp; Redis</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Thu, 08 Oct 2026 06:16:37 +0000</pubDate>
      <link>https://dev.to/stampiq/real-time-event-telemetry-ingesting-10k-scanssec-with-websockets-redis-2kjj</link>
      <guid>https://dev.to/stampiq/real-time-event-telemetry-ingesting-10k-scanssec-with-websockets-redis-2kjj</guid>
      <description>&lt;p&gt;During large-scale conferences, tech summits, and government expos, ingress traffic is never evenly distributed. Up to 80% of attendees arrive within a narrow 45-minute window before the opening keynote. &lt;/p&gt;

&lt;p&gt;When you have 10,000+ delegates simultaneously passing through turnstiles, badge scanners, and RFID portals, the telemetry ingestion pipeline faces an immediate high-concurrency bottleneck.&lt;/p&gt;

&lt;p&gt;Standard relational database writes and synchronous REST endpoints choke under this load. If an API request blocks, turnstiles experience physical delays, gate queues spill out into transit hubs, and live monitoring dashboards desynchronize.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here is the architectural blueprint for designing a high-throughput &lt;strong&gt;event analytics platform&lt;/strong&gt; capable of processing edge RFID reads, computing dynamic hall capacity, and streaming sub-second visual telemetry to operational dashboards.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  The System Requirements
&lt;/h2&gt;

&lt;p&gt;An enterprise-grade event reporting engine must deliver three architectural guarantees:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sub-10ms Gate Ack:&lt;/strong&gt; Hardware edge controllers cannot wait on network latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lossless Telemetry Buffering:&lt;/strong&gt; Every single entry, exit, and zone transit must be recorded with nanosecond-level sequencing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Second Dashboard Push:&lt;/strong&gt; Floor controllers need live gate influx velocity and zone capacity heatmaps pushed instantly, not polled.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ┌───────────────────────┐       ┌───────────────────────┐│  Overhead UHF Portal  │       │ Turnstile Badge Scan  ││  (Passive Telemetry)  │       │  (On-Demand Access)   │└──────────┬────────────┘       └──────────┬────────────┘│                               │▼                               ▼[ Edge MQTT Broker / TLS Micro-Payload ]│▼[ Ingestion Gateway (Go / Fastify) ]│▼[ Redis Streams Buffer (Memory) ]│┌─────────────┴─────────────┐▼                           ▼[ Worker Consumer Group ]    &lt;a href="https://dev.toAggregates%20&amp;amp;%20WAL%20Persistence"&gt; WebSocket Broadcast &lt;/a&gt;   (Live Ops Dashboard)
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Edge Communication: Micro-Payloads Over MQTT
&lt;/h2&gt;

&lt;p&gt;Avoid sending full JSON payloads from edge scanners. When hundreds of reader antennas are constantly interrogating passive tags, verbose JSON strings eat up local bandwidth and trigger garbage collection spikes on low-power gateway controllers.&lt;/p&gt;

&lt;p&gt;Instead, edge devices pack hardware events into a binary or compact buffer structure before publishing over MQTT:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
typescript
// Compact payload schema (16-byte fixed buffer structure)
// [4 bytes: Epoch Timestamp] [6 bytes: UHF EPC Hash] [2 bytes: Portal ID] [1 byte: Direction (0=In, 1=Out)]
interface GateEvent {
  timestamp: number;
  epcHash: string;
  portalId: number;
  direction: 'IN' | 'OUT';
}
The gateway receives these compact events, validates the structure, and immediately pushes them to an in-memory streaming queue without hitting disk storage.2. Ingestion Layer: High-Throughput Buffering with Redis StreamsTo decouple hardware ingestion from analytical aggregation, we feed incoming gateway streams directly into Redis Streams.Redis Streams provides ordered message logging with consumer groups, enabling concurrent workers to read and process telemetry without message duplication.JavaScript// telemetry_gateway.js
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);

export async function ingestTagTelemetry(req, res) {
  const { portalId, tagId, timestamp, direction } = req.body;

  try {
    // Non-blocking write to the incoming telemetry stream
    await redis.xadd(
      'stream:event_telemetry',
      '*', // Auto-generated monotonic message ID
      'portal_id', portalId,
      'tag_id', tagId,
      'timestamp', timestamp,
      'direction', direction
    );

    // Fast ACK back to the edge hardware
    return res.status(202).send({ status: 'QUEUED' });
  } catch (err) {
    console.error('Buffer write failure:', err);
    return res.status(500).send({ error: 'BUFFER_UNAVAILABLE' });
  }
}
3. Real-Time Aggregation &amp;amp; WindowingDisplaying raw scan logs is useless to event directors. Ops teams need velocity (attendees entering per minute) and occupancy (current delegates per zone).   A decoupled worker process consumes from the stream, maintains rolling 60-second sliding windows, and tracks active hall density using atomic Redis operations:JavaScript// aggregation_worker.js
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);

async function processTelemetryBatch() {
  const entries = await redis.xreadgroup(
    'GROUP', 'analytics_group', 'worker_node_1',
    'COUNT', '500',
    'BLOCK', '2000',
    'STREAMS', 'stream:event_telemetry', '&amp;gt;'
  );

  if (!entries || !entries.length) return;

  const [stream, messages] = entries[0];
  const pipeline = redis.pipeline();

  for (const [id, fields] of messages) {
    const data = Object.fromEntries(
      fields.reduce((acc, cur, i) =&amp;gt; (i % 2 === 0 ? acc.push([cur, fields[i + 1]]) : null, acc), [])
    );

    const delta = data.direction === 'IN' ? 1 : -1;
    const zoneKey = `occupancy:zone:${data.portal_id}`;

    // Atomically increment/decrement active zone count
    pipeline.incrby(zoneKey, delta);

    // Record entry frequency in a 60-second sliding time bucket
    const currentMinuteBucket = Math.floor(Date.now() / 60000);
    pipeline.hincrby(`rate:influx:${currentMinuteBucket}`, data.portal_id, 1);
    pipeline.expire(`rate:influx:${currentMinuteBucket}`, 3600); // 1-hour retention

    // Acknowledge processed message in the stream
    pipeline.xack('stream:event_telemetry', 'analytics_group', id);
  }

  await pipeline.exec();
}
4. Live Dashboard Streaming via WebSocketsInstead of browser dashboards polling REST endpoints every 3 seconds—which creates unnecessary database thundering herds during peak traffic—the application tier broadcasts state changes over WebSockets using Pub/Sub:JavaScript// websocket_publisher.js
import { WebSocketServer } from 'ws';
import Redis from 'ioredis';

const redisSub = new Redis(process.env.REDIS_URL);
const wss = new WebSocketServer({ port: 8080 });

// Subscribe to aggregated metric publications
redisSub.subscribe('channel:dashboard_updates', (err) =&amp;gt; {
  if (!err) console.log('Subscribed to real-time telemetry stream.');
});

redisSub.on('message', (channel, message) =&amp;gt; {
  // Broadcast unified metric frames to all connected monitoring screens
  wss.clients.forEach((client) =&amp;gt; {
    if (client.readyState === 1) { // WebSocket.OPEN
      client.send(message);
    }
  });
});
5. Architectural Safeguards for Mission-Critical VenuesBuilding technology for large-scale enterprise summits requires anticipating real-world failure states:   WAN Disconnections: Check-in points must use local SQLite instances with Write-Ahead Logging (WAL) as an edge-tier cache to ensure zero gate downtime if venue fiber is severed, 12].

Passive UHF Multiplexing: Instead of requiring manual scans, passive long-range antennas read smart credentials seamlessly as delegates walk through portal arches.

Sponsor ROI &amp;amp; Dwell Telemetry: Continuous time-in-range tracking allows the aggregation pipeline to calculate verifiable dwell times for partner pavilions without active manual check-ins.

If you are designing high-density event systems or deploying physical credential infrastructure across the GCC, check out how StampIQ architects its localized real-time event analytics dashboard and hardware-integrated RFID attendee tracking stacks to handle peak-scale operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>redis</category>
      <category>eventtech</category>
    </item>
    <item>
      <title>Building Offline-First Delegate Tracking with SQLite &amp; UHF RFID</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Wed, 07 Oct 2026 06:43:41 +0000</pubDate>
      <link>https://dev.to/stampiq/building-offline-first-delegate-tracking-with-sqlite-uhf-rfid-3lga</link>
      <guid>https://dev.to/stampiq/building-offline-first-delegate-tracking-with-sqlite-uhf-rfid-3lga</guid>
      <description>&lt;p&gt;High-density government summits, ministerial exhibitions, and corporate conferences across Riyadh, Jeddah, and the broader GCC are expanding rapidly under Saudi Vision 2030. With tens of thousands of registered VIPs and delegates arriving simultaneously, the physical and digital infrastructure at the gate dictates the entire operational outcome of the event. &lt;/p&gt;

&lt;p&gt;When you rely on standard cloud-only ticketing apps, intermittent venue Wi-Fi and API latency can bring check-in counters to a complete halt. Engineering true enterprise accreditation requires a localized, hardware-integrated stack: offline-resilient edge caching, cryptographic thermal encoding, and continuous passive telemetry.&lt;/p&gt;

&lt;p&gt;Here is how &lt;a href="https://stampiq.sa/" rel="noopener noreferrer"&gt;StampIQ&lt;/a&gt; architects infrastructure to guarantee zero-downtime registration and real-time delegate tracking at Saudi mega-events.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture of Queue Disruption
&lt;/h2&gt;

&lt;p&gt;Standard event tech stacks fail in enterprise environments for three main reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Latency:&lt;/strong&gt; Relying on a round-trip HTTP request to a central database for every attendee scan causes severe gate congestion when 5,000 visitors arrive at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optical Scan Bottlenecks:&lt;/strong&gt; Manual QR code scanners are slow, require deliberate positioning, and suffer in varying ambient lighting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Drops:&lt;/strong&gt; If the venue's ISP connection goes down, standard web-based portals crash entirely.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve this, we decoupled the physical gate operations from external internet connectivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Offline-First Edge Resilience with SQLite &amp;amp; WAL
&lt;/h3&gt;

&lt;p&gt;To prevent network interruptions from freezing our registration portals, every local check-in node runs an embedded SQLite database. Instead of polling an external server for every scan, client stations write locally, configured with &lt;strong&gt;Write-Ahead Logging (WAL)&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;WAL ensures that readers and writers do not block each other, allowing our nodes to process continuous high-throughput scans asynchronously.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
// Example SQLite Edge Node Configuration
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./edge_cache.db');

// Enable Write-Ahead Logging for non-blocking concurrent reads/writes
db.serialize(() =&amp;gt; {
  db.run("PRAGMA journal_mode=WAL;");
  db.run("PRAGMA synchronous=NORMAL;");

  // Create offline sync table
  db.run(`CREATE TABLE IF NOT EXISTS local_scans (
    id TEXT PRIMARY KEY,
    uhf_tag_id TEXT,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
    sync_status INTEGER DEFAULT 0
  )`);
});
Zero-Latency Processing: Check-ins are appended locally in under 5 milliseconds.   


![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/9s3z5734fi5hu3c9ewti.jpg)Deterministic Synchronization: Background workers stream differential updates to the central cloud cluster whenever network connectivity is active. If Wi-Fi drops, scanning continues unabated, syncing perfectly once the connection restores.   

2. Sub-3-Second Thermal Badge EncodingPre-printing badges causes administrative chaos. Our deployment standard relies on rapid on-demand thermal issuance directly integrated with automated badge sorting.   

As the digital pass is scanned, a direct thermal print engine processes the personalized badge in under 3 seconds. Simultaneously, an integrated encoder writes an encrypted payload (UHF EPC Gen 2 standard) to the badge's embedded microchip, guaranteeing that credentials cannot be cloned.   

3. Passive UHF RFID Portals for Zero-Contact TelemetryTo measure live hall capacities and sponsor booth exposure, we utilize passive UHF RFID overhead portals instead of tap-based NFC cards or manual barcode scanners.   Plaintext       [ Overhead UHF RFID Portal Array ]
                       │
       ┌───────────────┴───────────────┐
       ▼                               ▼
[ Antenna Beam: Lane A ]     [ Antenna Beam: Lane B ]

As delegates walk naturally through entry arches wearing their durable, waterproof UHF event wristbands, the portals harvest RF energy and read the cryptographic IDs at distances up to 8 meters. Utilizing advanced anti-collision framing, the edge readers filter up to 400 tag transmissions per second without signal corruption.   

4. Real-Time Analytics &amp;amp; Capacity ManagementWe stream this passive spatial telemetry back to a centralized event analytics platform, providing organizers with a custom KSA reporting dashboard.  

Security teams can monitor live gate influx and hall capacities dynamically, receiving automated alerts before venues exceed civil defense safety thresholds[cite: 12]. Floor managers can reallocate catering and staff instantly based on real-time crowd heatmap.

Engineering for Vision 2030The scale of modern Saudi business sectors demands highly resilient infrastructure. By bridging physical hardware integration with edge-caching software, event leaders can guarantee a flawless operational flow from the first scan to the final keynote.

If you are building or scaling localized enterprise infrastructure, explore how our secure event registration platform handles high-density workloads across the GCC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>eventtech</category>
      <category>rfid</category>
      <category>sqlite</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Architecting Passive RFID Event Solutions for 10,000+ Users</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Tue, 29 Sep 2026 05:27:08 +0000</pubDate>
      <link>https://dev.to/stampiq/architecting-passive-rfid-event-solutions-for-10000-users-4g09</link>
      <guid>https://dev.to/stampiq/architecting-passive-rfid-event-solutions-for-10000-users-4g09</guid>
      <description>&lt;p&gt;If you are tasked with building or scaling an &lt;strong&gt;event ticketing and management system in Saudi Arabia&lt;/strong&gt;, you will quickly discover that standard CRUD architectures fail at the physical edge. &lt;/p&gt;

&lt;p&gt;Most ticketing platforms rely on optical QR codes scanned by mobile phones. This creates a synchronous, line-of-sight ingestion bottleneck. It takes an usher 5 to 8 seconds to scan a screen. When 4,000 attendees arrive for a Vision 2030 exhibition in Riyadh or Dammam, this manual process collapses, resulting in massive doorway queues and compromised perimeter security.&lt;/p&gt;

&lt;p&gt;To achieve frictionless high-concurrency access control, we had to eliminate line-of-sight scanning entirely. Here is a technical teardown of how we architect &lt;strong&gt;&lt;a href="https://stampiq.sa/services/attendee-tracking" rel="noopener noreferrer"&gt;RFID event solutions&lt;/a&gt;&lt;/strong&gt; using passive IoT telemetry and edge computing.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Physical Layer: Moving from Active to Passive Ingestion
&lt;/h2&gt;

&lt;p&gt;True &lt;strong&gt;&lt;a href="https://stampiq.sa/services/attendee-tracking" rel="noopener noreferrer"&gt;RFID delegate tracking management&lt;/a&gt;&lt;/strong&gt; requires decoupling the user from the validation process. The attendee should not have to stop, tap, or present a screen. &lt;/p&gt;

&lt;p&gt;We utilize passive Ultra-High Frequency (UHF EPC Gen 2) infrastructure. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Smart Wearables (The Token):&lt;/strong&gt; For indoor corporate events, self-service kiosks encode a UUID onto an embedded RFID badge chip in under 3 seconds. However, for active outdoor environments like desert equestrian cups, paper badges are a safety hazard. Instead, we provision waterproof, tamper-proof &lt;strong&gt;&lt;a href="https://stampiq.sa/rfid-wristbands" rel="noopener noreferrer"&gt;RFID wristbands&lt;/a&gt;&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Overhead Portals (The Ingestion Node):&lt;/strong&gt; We mount high-gain UHF reader antennas above natural venue archways. These act as passive ingestion nodes, reading hundreds of credentials simultaneously across a multi-meter read zone at normal walking speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The Edge Controller: Handling IoT Noise
&lt;/h2&gt;

&lt;p&gt;RFID hardware is notoriously noisy. A single &lt;strong&gt;&lt;a href="https://stampiq.sa/rfid-wristbands" rel="noopener noreferrer"&gt;RFID wristband&lt;/a&gt;&lt;/strong&gt; lingering near a portal can generate 500 raw read events in a minute. If you pipe this raw chatter directly to a cloud API, you will effectively DDoS your own infrastructure.&lt;/p&gt;

&lt;p&gt;We deploy local Edge Controllers (industrial Linux boxes) at every portal. These run a lightweight daemon written in Go to debounce the noise using an in-memory state machine. &lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
go
package main

import (
    "time"
    "sync"
)

// In-memory cache to debounce noisy UHF reads
type TagCache struct {
    mu    sync.RWMutex
    reads map[string]time.Time
}

const debounceWindow = 15 * time.Second

func (c *TagCache) ProcessRawRead(epc string, zone string) *TransitionPayload {
    c.mu.Lock()
    defer c.mu.Unlock()

    lastRead, exists := c.reads[epc]
    now := time.Now()

    // If the tag was read recently, ignore it (debounce)
    if exists &amp;amp;&amp;amp; now.Sub(lastRead) &amp;lt; debounceWindow {
        return nil 
    }

    // Update cache and emit a clean transition event
    c.reads[epc] = now
    return &amp;amp;TransitionPayload{
        EPC:       epc,
        Zone:      zone,
        Timestamp: now.UnixMilli(),
        Direction: "ENTER",
    }
}
This Go daemon outputs a single, clean JSON transition payload. Because venue Wi-Fi is often unstable, the daemon queues these payloads in a local SQLite Write-Ahead Log (WAL) and flushes them to the cloud broker via MQTT (QoS 1) only when the network is healthy, ensuring zero data loss.

3. The Analytics Pipeline: Sub-Second Telemetry
Once the clean MQTT payloads hit the cloud, they are routed through Redis Streams to update a high-availability State Engine. This engine calculates exact zone capacities and entries-per-minute dynamically.

This data feeds directly via WebSockets into our client-facing UI. Whether an event director needs a standard overview in Riyadh or a premium custom reporting dashboard in Dammam, the UI updates in milliseconds without requiring a page refresh.

Command centers can monitor:

Live Gate Velocity: Spotting entry bottlenecks before queues form.

Room Capacity: Ensuring strict civil defense compliance in VIP lounges.

Auditable Sponsor Dwell Time: Calculating verified ROI for delegates who spent 15+ minutes engaged at commercial exhibition booths.

Securing Enterprise Perimeters
This offline-first, passive architecture is actively securing the GCC's most demanding events. During the Sport Investment Forum, operations teams tracked 3,500+ VIP credentials across multiple zones seamlessly. At the AlFursan Endurance Cup AlUla, the platform secured 5,000+ participants using smart wearables across 6 remote desert zones.

If you are an engineer tasked with scaling event access control, stop building cloud-dependent QR scanners. Explore the edge-resilient telemetry pipelines and RFID hardware being deployed by StampIQ.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>iot</category>
      <category>systemdesign</category>
      <category>edgecomputing</category>
      <category>architecture</category>
    </item>
    <item>
      <title>System Design: Building an Offline-First RFID Access Control Pipeline for 10,000+ Users</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Mon, 28 Sep 2026 05:42:24 +0000</pubDate>
      <link>https://dev.to/stampiq/system-design-building-an-offline-first-rfid-access-control-pipeline-for-10000-users-p58</link>
      <guid>https://dev.to/stampiq/system-design-building-an-offline-first-rfid-access-control-pipeline-for-10000-users-p58</guid>
      <description>&lt;p&gt;If you are a backend engineer tasked with building an event tech stack, it is easy to confuse &lt;strong&gt;event accreditation&lt;/strong&gt; with &lt;strong&gt;access control&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Event accreditation is a standard web application problem: a user fills out a form on your &lt;strong&gt;&lt;a href="https://stampiq.sa/registration-platform" rel="noopener noreferrer"&gt;registration platform&lt;/a&gt;&lt;/strong&gt;, you run a background check, and you assign them a role (e.g., "VIP" or "Media") in a PostgreSQL database. &lt;/p&gt;

&lt;p&gt;However, &lt;strong&gt;&lt;a href="https://stampiq.sa/services/attendee-tracking" rel="noopener noreferrer"&gt;RFID delegate tracking management&lt;/a&gt;&lt;/strong&gt;—the physical enforcement of those roles at the actual venue—is an entirely different beast. It is a high-stakes, high-concurrency IoT problem. &lt;/p&gt;

&lt;p&gt;If you rely on cloud-connected mobile apps to scan QR codes at the venue doors, your system will collapse the moment the venue Wi-Fi drops or a local cellular tower saturates. When 500 VIPs are trying to enter a keynote hall and your API is returning &lt;code&gt;504 Gateway Timeout&lt;/code&gt;, the security guards will simply wave the crowd through, destroying your security perimeters.&lt;/p&gt;

&lt;p&gt;To secure massive Vision 2030 exhibitions in Saudi Arabia, we had to eliminate the cloud dependency at the door. Here is how we architected an offline-first, passive RFID access control system.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Edge Architecture: Moving Validation to the Portal
&lt;/h2&gt;

&lt;p&gt;To eliminate doorway bottlenecks, we utilize passive Ultra-High Frequency (UHF) overhead portals. As delegates walk through an archway, the portal reads their embedded RFID badge. &lt;/p&gt;

&lt;p&gt;Instead of sending that read event to the cloud for validation, the portal communicates via a local wired LAN to an Edge Controller (typically an industrial fanless PC or a hardened Raspberry Pi Compute Module). &lt;/p&gt;

&lt;p&gt;The Edge Controller runs a lightweight daemon (often written in Go or Rust for memory safety and concurrency) and a local SQLite database containing the synchronized Access Control List (ACL).&lt;/p&gt;

&lt;h3&gt;
  
  
  The Edge Validation Logic (Go Concept)
&lt;/h3&gt;

&lt;p&gt;When an RFID EPC (Electronic Product Code) is read, the daemon queries the local SQLite DB in microseconds. It does not wait for a cloud API.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
go
package main

import (
    "database/sql"
    "fmt"
    "time"
    _ "[github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)"
)

// ValidateAccess checks the local edge database for tier permissions
func ValidateAccess(db *sql.DB, epc string, portalZone string) (bool, error) {
    var isAllowed int

    // Query the local, synchronized Access Control List
    query := `
        SELECT COUNT(*) 
        FROM local_acl 
        WHERE epc_tag = ? AND allowed_zone = ? AND revoked = 0
    `
    err := db.QueryRow(query, epc, portalZone).Scan(&amp;amp;isAllowed)
    if err != nil {
        return false, err
    }

    // Log the transition locally for later cloud syncing
    logTransition(db, epc, portalZone, isAllowed &amp;gt; 0, time.Now().Unix())

    return isAllowed &amp;gt; 0, nil
}
If ValidateAccess returns true, the edge controller triggers a local GPIO relay to flash a green LED or open a physical turnstile. The entire round-trip takes less than 10 milliseconds.

2. The Sync Pipeline: MQTT Quality of Service 1
Just because validation happens offline does not mean the cloud stays blind. Operations teams still need a live real-time event analytics dashboard to monitor venue capacity.

To handle unreliable event networks, we use MQTT as our transport layer.

Cloud-to-Edge (ACL Sync): When a new VIP registers at a desk, the cloud pushes an MQTT message to the specific Edge Controller updating its local SQLite database.

Edge-to-Cloud (Telemetry Sync): As the edge controller validates badges, it queues those transition payloads. It uses MQTT Quality of Service (QoS) 1 to push the queue to the cloud. QoS 1 guarantees that the payload is delivered at least once.

If the internet goes down, the Edge Controller continues validating delegates perfectly using its local SQLite DB. Once the internet restores, the MQTT client automatically reconnects and flushes the queued telemetry to the cloud broker, backfilling the dashboard without any data loss.

Proven in the Desert: The AlFursan Endurance Cup
This architecture is not just a theoretical whiteboard exercise.

During the AlFursan Endurance Cup AlUla, the venue was spread across a remote desert environment with highly unstable cellular connectivity. By deploying offline-first edge controllers, StampIQ secured 5,000+ participants across 6 distinct security zones. Validation never went down, and the telemetry synced flawlessly whenever the connection stabilized.

Similarly, during the HUMAIN LEAP summit and the Gulf Cup Draw Ceremony, this edge architecture managed strict multi-tier access control seamlessly, feeding accurate capacity data directly to event directors without introducing doorway friction.

If you are an engineer or technical director tasked with modernizing access control for major GCC events, stop relying on cloud-dependent barcode scanners.

For enterprise-grade edge hardware and resilient RFID delegate tracking management, explore the infrastructure built by StampIQ.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>iot</category>
      <category>edgecomputing</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>System Design: Building a Real-Time Event Reporting Platform for 10,000+ Concurrency</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Fri, 25 Sep 2026 06:57:17 +0000</pubDate>
      <link>https://dev.to/stampiq/system-design-building-a-real-time-event-reporting-platform-for-10000-concurrency-3dod</link>
      <guid>https://dev.to/stampiq/system-design-building-a-real-time-event-reporting-platform-for-10000-concurrency-3dod</guid>
      <description>&lt;p&gt;A question that frequently comes up in enterprise event tech circles is: &lt;em&gt;"Which platforms offer real-time event reporting?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From a software engineering perspective, this question highlights a massive flaw in legacy event management systems. Most standard registration apps do not offer reporting; they offer &lt;strong&gt;batch processing&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;When a venue relies on mobile apps or optical QR code scanners for access control, they are forcing a synchronous, manual ingestion process. An usher scans a badge, the device makes an API call, and a single timestamp is logged. If the venue loses Wi-Fi, or if 3,000 people rush the gates for a keynote panel, the system bottlenecks. The ushers stop scanning, wave the crowd through, and your data integrity is destroyed. &lt;/p&gt;

&lt;p&gt;To solve high-concurrency tracking for Saudi Arabia's Vision 2030 mega-events, we had to completely re-architect how spatial data is captured. In this post, we will tear down the edge-to-cloud architecture used to build a true &lt;strong&gt;&lt;a href="https://stampiq.sa/services/real-time-analytics" rel="noopener noreferrer"&gt;event analytics platform&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Edge: Decoupling Validation from Cloud Latency
&lt;/h2&gt;

&lt;p&gt;If you want real-time reporting without doorway queues, you must move away from line-of-sight optical scanning. &lt;/p&gt;

&lt;p&gt;We shifted the ingestion layer to passive Ultra-High Frequency (UHF EPC Gen 2) infrastructure. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Instant Edge Provisioning:&lt;/strong&gt; At registration, self-service kiosks execute high-speed thermal &lt;strong&gt;&lt;a href="https://stampiq.sa/badge-printing" rel="noopener noreferrer"&gt;badge printing&lt;/a&gt;&lt;/strong&gt;. A secure, unique UUID is encoded directly onto an embedded UHF inlay in under three seconds. For outdoor tournaments, the payload goes onto waterproof &lt;strong&gt;&lt;a href="https://stampiq.sa/rfid-wristbands" rel="noopener noreferrer"&gt;RFID wristbands&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Passive Overhead Portals:&lt;/strong&gt; We mount UHF reader antennas above natural venue archways. These act as our edge ingestion nodes, utilizing passive &lt;strong&gt;&lt;a href="https://stampiq.sa/services/attendee-tracking" rel="noopener noreferrer"&gt;RFID attendee tracking&lt;/a&gt;&lt;/strong&gt; to read hundreds of credentials simultaneously at normal walking speeds.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Solving the "Noisy Edge" Problem
&lt;/h3&gt;

&lt;p&gt;RFID antennas generate massive amounts of duplicate reads (chatter). If a delegate stands near an archway for two minutes, the hardware might fire 600 raw read events. &lt;/p&gt;

&lt;p&gt;To prevent this from overwhelming the cloud broker, we deploy lightweight edge daemons (running Go or Node.js on local controllers) that maintain an in-memory Bloom filter. They debounce the raw chatter and emit a single, clean JSON transition payload:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
json
{
  "uuid": "req_8841a_99b",
  "epc_tag": "urn:epc:tag:sgtin-96:3.1415.926.53",
  "portal_node": "zone_media_gate_alpha",
  "transition": "ENTER",
  "timestamp": 1727265400000
}
This payload is then pushed to the cloud via MQTT. Because venue Wi-Fi is notoriously unreliable, the edge daemon uses an offline-first SQLite write-ahead log to queue payloads locally during network drops, ensuring zero data loss.

2. Cloud Ingestion: Redis Streams for Live Telemetry
Once the MQTT payloads hit the cloud, they enter a streaming pipeline designed for time-series velocity. Standard relational databases (like PostgreSQL) are too slow for calculating live spatial heatmaps across thousands of concurrent users.

We route the telemetry into Redis Streams. This allows our backend services to fan-out the processing:

Service A (Historical Worker): Consumes the stream, batches the payloads, and writes them to PostgreSQL for post-event auditing.

Service B (State Engine): Consumes the stream to update real-time counters and Sorted Sets (ZSET), maintaining the exact live capacity of every room in the venue.

JavaScript
// Node.js State Engine: Updating live room capacity via Redis
const Redis = require('ioredis');
const redis = new Redis(process.env.REDIS_URL);

async function handleTransition(payload) {
    const { portal_node, transition } = payload;
    const roomKey = `live_capacity:${portal_node}`;

    // Atomically update the room's occupancy count
    const increment = transition === 'ENTER' ? 1 : -1;
    const newCapacity = await redis.hincrby(roomKey, 'occupancy', increment);

    // Publish the delta for WebSocket broadcasting
    redis.publish('venue_telemetry', JSON.stringify({
        room: portal_node,
        capacity: newCapacity,
        timestamp: Date.now()
    }));
}
3. The Client: Sub-Second Dashboard Updates
The final piece of the architecture is the client interface. Event directors do not want to click "refresh" on a web page to see if a hall is overcrowded.

We connect our Next.js frontend to a Node.js WebSocket gateway. The gateway subscribes to the Redis venue_telemetry channel and broadcasts JSON deltas directly to the client.

This infrastructure powers a true real-time event analytics dashboard. The operations team can instantly monitor:

Gate Influx Velocity: Entries per minute visualized on a time-series line chart.

Room Retention Curves: Live tracking of breakout session drop-off rates.

Qualified Sponsor Dwell Time: Filtering out 1-minute "passersby" to calculate exact ROI for delegates who spent 15+ minutes at a specific exhibition booth.

Real-World Stress Testing
This architecture is currently securing the GCC’s most demanding mega-events. During the Sport Investment Forum, government stakeholders required flawless live tracking for 3,500+ VIPs across multiple zones without introducing doorway friction. By decoupling physical validation from cloud latency, the security team maintained absolute situational awareness.

If you are an engineer or technical director tasked with modernizing enterprise event infrastructure, stop trying to force legacy batch-processing apps to act like live analytics tools.

For enterprise-grade edge hardware and streaming cloud architecture, explore the telemetry pipelines being built at StampIQ.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>systemdesign</category>
      <category>iot</category>
      <category>websockets</category>
    </item>
    <item>
      <title>How to Build a Real-Time Event Analytics Platform: Streaming RFID Edge Data to Live Dashboards</title>
      <dc:creator>stampiq</dc:creator>
      <pubDate>Thu, 24 Sep 2026 07:23:29 +0000</pubDate>
      <link>https://dev.to/stampiq/how-to-build-a-real-time-event-analytics-platform-streaming-rfid-edge-data-to-live-dashboards-10cg</link>
      <guid>https://dev.to/stampiq/how-to-build-a-real-time-event-analytics-platform-streaming-rfid-edge-data-to-live-dashboards-10cg</guid>
      <description>&lt;p&gt;If you are a backend engineer working in the event tech space, you know the fatal flaw of legacy registration systems: &lt;strong&gt;they treat human movement as batch data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Standard ticketing platforms rely on optical QR code scanners. A guest arrives, an usher scans the code, and a timestamp is pushed to a database. The event director doesn't see that data until two weeks later when someone exports a massive CSV file. That is not analytics; that is a post-mortem.&lt;/p&gt;

&lt;p&gt;As physical gatherings scale—especially across Saudi Arabia’s Vision 2030 mega-events, where venues host 10,000+ concurrent attendees—batch processing fails. Government stakeholders and commercial sponsors now require a true &lt;strong&gt;&lt;a href="https://stampiq.sa/services/real-time-analytics" rel="noopener noreferrer"&gt;event analytics platform&lt;/a&gt;&lt;/strong&gt; that streams spatial telemetry live.&lt;/p&gt;

&lt;p&gt;In this post, we will tear down the architecture required to build a streaming analytics pipeline that converts passive RFID reads into a live command dashboard.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Edge: Moving from Optical to Passive Ingestion
&lt;/h2&gt;

&lt;p&gt;To build a real-time dashboard, you must first eliminate the physical doorway bottleneck. If your ingestion rate is capped by the 5-8 seconds it takes a human to scan a QR code, your telemetry will always be delayed and incomplete.&lt;/p&gt;

&lt;p&gt;We solve this by shifting to passive Ultra-High Frequency (UHF) edge infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Sub-Second Provisioning:&lt;/strong&gt; When a user registers, a local thermal kiosk executes a &lt;strong&gt;&lt;a href="https://stampiq.sa/badge-printing" rel="noopener noreferrer"&gt;badge printing&lt;/a&gt;&lt;/strong&gt; routine that encodes a secure payload onto a passive UHF Gen 2 inlay in under three seconds.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Continuous Read States:&lt;/strong&gt; As attendees move, overhead portal antennas capture their movement at walking speed. This is passive &lt;strong&gt;&lt;a href="https://stampiq.sa/services/attendee-tracking" rel="noopener noreferrer"&gt;RFID attendee tracking&lt;/a&gt;&lt;/strong&gt;—the attendee does not stop, and no human usher is involved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Edge Deduplication (The "Chatter" Problem)
&lt;/h3&gt;

&lt;p&gt;Raw RFID antennas are incredibly noisy. If a VIP stands near a portal talking to a colleague for three minutes, the antenna might fire 500 identical read events. &lt;/p&gt;

&lt;p&gt;To prevent overwhelming the cloud broker, edge daemons (usually written in Go or Rust) use an in-memory sliding window or Bloom filter to debounce these reads, emitting a single, clean state-transition payload:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
json
{
  "event_id": "EVT-9092",
  "delegate_epc": "urn:epc:tag:sgtin-96:3.0614.812.67",
  "portal_id": "zone_vip_lounge_in",
  "timestamp": 1727181045000
}
2. The Cloud Ingestion &amp;amp; Stream Processing Pipeline
Because event venues often suffer from network latency or saturated cellular towers, edge payloads are pushed to the cloud via MQTT (Quality of Service 1) to ensure delivery even if connection drops occur.

Once the payload reaches the cloud, it hits an ingestion pipeline designed for time-series velocity, bypassing traditional relational databases for the live state.

We pipe the MQTT data directly into Redis Streams. This allows us to fan out the telemetry to multiple worker services simultaneously:

Cold Storage Worker: Consumes the stream and batch-writes to PostgreSQL for post-event auditing and historical reporting.

Aggregation Engine (State): Consumes the stream to update real-time counters.

For example, keeping a live count of the VIP Lounge capacity:

JavaScript
// Node.js worker consuming Redis Stream to update live capacity
const Redis = require('ioredis');
const redis = new Redis();

async function processTransition(eventPayload) {
    const { portal_id, direction } = eventPayload;

    // Determine the zone based on portal mapping
    const zone = mapPortalToZone(portal_id); 

    if (direction === 'IN') {
        // Atomically increment the zone capacity
        await redis.hincrby(`live_capacity:${zone}`, 'count', 1);
    } else if (direction === 'OUT') {
        await redis.hincrby(`live_capacity:${zone}`, 'count', -1);
    }

    // Publish the delta for WebSocket broadcasting
    const currentCount = await redis.hget(`live_capacity:${zone}`, 'count');
    redis.publish('dashboard_updates', JSON.stringify({ zone, count: currentCount }));
}
3. Broadcasting to the Real-Time Event Analytics Dashboard
The final layer is the client interface. Event operations directors need a visual, zero-refresh interface—a true real-time event analytics dashboard.

We deploy a Node.js WebSocket gateway that subscribes to the Redis dashboard_updates Pub/Sub channel. The frontend (Next.js/React) maintains an open WebSocket connection, instantly re-rendering UI components as spatial data flows in.

Instead of waiting for an end-of-day spreadsheet, the operations team monitors:

Gate Influx Velocity (Time-Series): Entries per minute to detect and prevent perimeter bottlenecks.

Zone Heatmaps (Live State): Instant alerts if a specific breakout room exceeds civil defense safety limits.

Qualified Sponsor Dwell (Aggregated): Filtering out "passersby" to calculate exact ROI for delegates who spent 15+ minutes at a booth.

Proven Execution at Saudi Mega-Events
Building this architecture is not a theoretical exercise; it is an operational requirement for modern high-concurrency environments.

During the Sport Investment Forum in Saudi Arabia, government stakeholders required flawless tracking for 3,500+ VIPs across multiple zones without introducing doorway friction. By decoupling physical validation from cloud latency and utilizing edge-first telemetry, the event operations team maintained absolute situational awareness.

If you are an engineer or technical director tasked with modernizing MICE infrastructure in the GCC, stop trying to turn static registration software into an analytics engine. For enterprise-grade edge hardware and streaming cloud architecture, explore the telemetry pipelines being built at StampIQ.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>architecture</category>
      <category>data</category>
      <category>iot</category>
      <category>sysdesign</category>
    </item>
  </channel>
</rss>
