DEV Community

Cover image for Architecting High-Concurrency B2B Matchmaking & Edge Access for LEAP Saudi Arabia
stampiq
stampiq

Posted on

Architecting High-Concurrency B2B Matchmaking & Edge Access for LEAP Saudi Arabia

Managing executive interactions at mega-events like LEAP in Riyadh presents complex distributed systems challenges. When government ministers, global enterprise CEOs, and venture capital delegations need to conduct bilateral negotiations in high-density exhibition environments, generic calendar tools and cloud-first booking APIs fail.

Standard systems fail during mega-events due to three primary bottlenecks:
1.Network Degradation: 15,000+ connected mobile devices cause severe radio frequency (RF) saturation, triggering API request timeouts on venue Wi-Fi and 5G networks.
2.Race Conditions in Physical Allocation:** Concurrent booking requests lead to double-booking of physical VIP suites and bilateral meeting pods.
3.Protocol Violations:** Unregulated scheduling flows expose ministerial calendars to unvetted attendees.

Here is the architectural breakdown of how we engineered a deterministic, role-based matchmaking engine synchronized with on-premise physical access control for government event management in Saudi Arabia.


System Architecture Overview

The system bridges digital schedule orchestration with physical venue turnstiles and meeting pod door controllers.

┌────────────────────────────────────────────────────────────────────────┐│ CLOUD SCHEDULING & RBAC ENGINE ││ ││ ┌───────────────────────┐ ┌──────────────────────────────────────┐ ││ │ Clearance Tier Matrix │ │ In-Memory Locking (Redis Mutex/Redlock)││ └───────────┬───────────┘ └──────────────────┬───────────────────┘ │└──────────────┼──────────────────────────────────┼──────────────────────┘│ │(State Distribution Sync) (Encrypted ACL Stream)│ │▼ ▼┌────────────────────────────────────────────────────────────────────────┐│ LOCAL VENUE EDGE NODE (Riyadh LAN) ││ ││ ┌───────────────────────────────┐ ┌────────────────────────────┐ ││ │ Ephemeral ACL Credential Cache│ │ Local RS-485 / Relays │ ││ │ (Time-Bound Suite Keys) │ │ (Sub-20ms Pod Actuation) │ ││ └──────────────▲────────────────┘ └─────────────▲──────────────┘ │└──────────────────┼──────────────────────────────────┼──────────────────┘│ │[Delegate UHF RFID Badge] [VIP Meeting Suite Door]

  1. Clearance-Tiered Role-Based Access Control (RBAC)

To protect diplomatic protocol and executive schedules, the matchmaking system uses bitmask evaluations to filter calendar visibility and meeting initiation rights.

Participants are categorized into discrete clearance tiers compiled during pre-registration on the online event registration platform:


python
from enum import IntFlag
from typing import Optional
import time

class ClearanceTier(IntFlag):
    GENERAL_DELEGATE = 1 << 0  # 00001 (1)
    MEDIA_BROADCAST  = 1 << 1  # 00010 (2)
    EXHIBITOR_TECH   = 1 << 2  # 00100 (4)
    ENTERPRISE_EXEC  = 1 << 3  # 01000 (8)
    MINISTER_ROYAL   = 1 << 4  # 10000 (16)

class MatchmakingRulesEngine:
    @staticmethod
    def can_request_meeting(requester: ClearanceTier, target: ClearanceTier) -> bool:
        Ministerial tiers can only be requested by Ministers or approved Enterprise Execs
        if target & ClearanceTier.MINISTER_ROYAL:
            return bool(requester & (ClearanceTier.MINISTER_ROYAL | ClearanceTier.ENTERPRISE_EXEC))

        General attendees cannot directly initiate bilateral VIP bookings
        if requester & ClearanceTier.GENERAL_DELEGATE:
            return bool(target & ClearanceTier.GENERAL_DELEGATE)

        return True
2. Preventing Spatial Race Conditions via Distributed LocksPhysical meeting suites are finite assets. To prevent concurrent booking conflicts across thousands of concurrent active sessions, the platform uses distributed key locks with automatic expiry windows:Pythonimport redis
import uuid

Connect to local Redis cluster
redis_client = redis.Redis(host='localhost', port=6379, db=0)

def book_physical_suite(suite_id: str, slot_epoch: int, meeting_id: str, ttl_seconds: int = 30) -> bool:
    lock_key = f"lock:suite:{suite_id}:{slot_epoch}"
    lock_token = str(uuid.uuid4())

    Acquire non-blocking distributed lock
    acquired = redis_client.set(lock_key, lock_token, nx=True, ex=ttl_seconds)
    if not acquired:
        return False  # Slot is actively being reserved by another thread

    try:
        Atomic allocation of the physical room to the meeting ID
        allocation_key = f"allocated:suite:{suite_id}:{slot_epoch}"
        redis_client.set(allocation_key, meeting_id)
        return True
    finally:
        Release the lock token via Lua script for atomic verification
        lua_release_lock = """
        if redis.call('get', KEYS[1]) == ARGV[1] then
            return redis.call('del', KEYS[1])
        else
            return 0
        end
        """
        redis_client.eval(lua_release_lock, 1, lock_key, lock_token)
3. Edge-Synchronized Ephemeral Physical AccessOnce a bilateral meeting is confirmed, the system avoids reliance on cloud lookups when attendees arrive at the physical suite.
**Ephemeral Credential Generation:** The scheduler issues a time-bound cryptographic grant valid strictly for $[T_{\text{start}} - 5\text{ min},\, T_{\text{end}} + 5\text{ min}]$.
**Edge Sync: **The access permission is pre-synced to the on-premise edge node over the venue LAN.

**Sub-20ms Ingress:** When attendees arrive and tap their UHF RFID badge or wristband at the meeting pod reader, the edge node validates the in-memory credential cache and actuates the electronic lock without external internet dependencies.

4. Asynchronous Telemetry PipelineAll access validations, suite utilization patterns, and queue transitions feed directly into an asynchronous Redis stream. 

**An edge daemon pushes batched telemetry to the real-time event analytics dashboard, providing event directors with live operational metrics:**$$\text{Suite Occupancy Rate} = \frac{\sum \text{Active Meeting Units}}{\text{Total Available Pods}} \times 100$$Dwell Time Verification: Quantifies actual bilateral session durations versus reserved durations.

**Security Alerts:** Detects and flags unauthorized credential scans at diplomatic suites in real time.Capacity Governance: Ensures fire-safety limits and venue protocols remain strictly compliant.

**Architectural TakeawaysEliminate WAN Dependencies for Physical Ingress: **Keep physical door actuation and RFID validation localized to an in-memory edge cache.

**Couple Digital Agendas with Spatial State:** Treat meeting rooms as stateful, lockable resources rather than static calendar metadata.Isolate 

**Telemetry from Control Logic:** Process physical entry in real time ($<20\text{ms}$), while streaming telemetry payloads asynchronously.
For full deployment specifications, hardware schematics, and case analysis from the HUMAIN summit at LEAP in Riyadh, explore the complete StampIQ LEAP Case Study.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)