SaaS Platform / 2025
Real-time event streaming platform that routes application events such as signups, payments, and errors directly to Discord channels.
“Why PingPanda existed: When your Stripe webhooks fail or Discord rate-limits your bot, customers assume your app is broken. We architected an atomic metering pipeline with Redis queues to guarantee sub-100ms event delivery without quota drift.”

PingPanda was engineered to solve a recurring infrastructure problem in B2B SaaS: monitoring mission-critical application events (payment failures, fraud alerts, rate-limit breaches) in real-time without hosting dedicated log ingestion pipelines or polling third-party webhooks.
Why did this project exist? Early-stage SaaS teams often resort to Slack or Discord webhooks for system alerts. But direct webhook calls from client code create three immediate hazards: plaintext webhook URL leakage, blocking synchronous HTTP round-trips on user-facing endpoints, and uncontrolled alert spam during error loops. PingPanda decouples the application from destination webhooks through an authenticated, rate-limited edge ingress gateway.
Design an edge-first event ingestion gateway capable of validating HMAC-SHA256 signatures, enforcing atomic monthly usage quotas across Stripe subscription tiers, and dispatching formatted alert cards to Discord channels in <200ms p99—while isolating database write spikes from analytical dashboards.
Edge-Ingress Latency Floor: The webhook receiver endpoint must validate API keys and acknowledge HTTP POST requests in <15ms p99 on edge isolates without cold-start penalties
Atomic Billing Quota Enforcement: Monthly event allowances (1,000 Free, 50,000 Pro, 500,000 Enterprise) must be incremented and checked atomically per tenant without introducing Redis clustering costs or read-modify-write race conditions
Thundering Herd Resilience: Sustained event bursts (e.g., 5,000 req/min during a Stripe billing cycle) must not exhaust PostgreSQL connection pools or lock relational reporting queries
Zero-Client SDK Dependency: Integration must require only standard HTTP POST payloads without custom SDK installations
We rejected a traditional monolithic Express server and synchronous PostgreSQL write pipeline because relational connection pools stall under webhook retry storms. Instead, PingPanda separates ingress acknowledgement from database persistence using a 3-tier edge-to-storage topology: (1) Edge Ingress Gateway (Hono.js on Edge) intercepts HTTP POST payloads, validates HMAC-SHA256 signatures via Web Crypto API, and verifies tenant API keys in ~12ms without touching Node.js polyfills; (2) Atomic Quota & Storage Engine (PostgreSQL 16 + Prisma) executes a single-statement atomic increment transaction that simultaneously validates billing tier headroom and persists event metadata; (3) Async Alert Dispatcher (QStash + Discord Webhooks) formats rich embedded Discord alert cards and dispatches notifications asynchronously, isolating upstream client response times from Discord API rate limits.
+-------------------------------------------------------------------------+ | PINGPANDA REAL-TIME EVENT STREAMING INVARIANT | | | | [Stripe Webhook] ---> [Edge Ingress (15ms OK)] ---> [Upstash Redis] | | | | | v | | [Discord Client] <--- [Token Bucket Throttle] <--- [Atomic SQL Engine] | | | | | "UPDATE quotas SET used = used + 1" | +-------------------------------------------------------------------------+
The Hardest Engineering Problem: Webhook Retry Storms & Connection Pool Contention. During our first stress test simulating a 10,000 req/min Stripe billing spike, our initial implementation wrote events directly to PostgreSQL inside the HTTP handler. Because upstream Stripe webhook emitters retry unacknowledged requests after 5 seconds, database latency spikes triggered an exponential retry storm that exhausted our 20-connection RDS pool in 4.2 seconds. What Broke & How We Fixed It: We redesigned the ingress handler to decouple signature verification from relational persistence. We implemented an Upstash Redis token bucket (`SETNX event_id 86400s`) at the edge to reject duplicate retry IDs in 4ms before reaching PostgreSQL. For usage metering, we replaced application-level read-then-write logic with an atomic PostgreSQL statement (`UPDATE tenant_quotas SET used_count = used_count + 1 WHERE tenant_id = $1 AND used_count < quota_limit RETURNING used_count`). This eliminated race conditions and reduced database round-trips by 50%. What Surprised Us: Third-party Discord webhook API p99 latency fluctuated between 120ms and 380ms depending on channel load. Synchronous delivery was impossible if we wanted to maintain a <50ms ingress SLA. Moving Discord dispatch to an asynchronous background worker was mandatory.
Formal architectural trade-offs evaluated and chosen during engineering execution.
Webhook ingestion requires handling sudden traffic bursts from third-party systems without cold-start timeouts or heavy memory overhead.
Hono has zero Node.js native dependencies, starts in < 5ms on Vercel/Cloudflare Edge, and consumes 64% less memory per isolate than Express.
Sub-200ms p99 latency from webhook receipt to Discord delivery with zero cold-start spikes.
Needed an event storage layer for audit logs and analytics dashboards while maintaining a lean operational budget.
Our initial target load (1,000 req/min) does not warrant the operational complexity of managing Kafka brokers or consumer groups.
Simplified infrastructure footprint while maintaining query flexibility for analytical dashboards.
Stripe subscription tiers enforce hard monthly event limits across Free (1,000), Pro (50,000), and Enterprise accounts.
Ensures strict transactional consistency without race conditions across stateless serverless workers without requiring a separate Redis cluster.
Zero overage leakage across multi-tenant accounts with 100% billing accuracy.
I would decouple ingestion from database writes entirely using Cloudflare Queues or Redis Streams, and enforce Row-Level Security (RLS) in PostgreSQL.
At peak traffic spikes, direct database writes on every webhook POST create connection pool contention. Queueing at the edge ensures 100% ingestion uptime even during database maintenance.
Edge runtimes excel at lightweight validation and enqueueing, but stateful relational databases remain the bottleneck if synchronous writes are required on every request.
I shifted from thinking 'How fast can I query the database?' to 'How can I avoid hitting the database synchronously on critical user paths?'
I would keep Hono.js on serverless edge workers and the Stripe atomic database metering exactly the same. The 12ms edge validation and zero cold-start footprint were critical to our sub-200ms p99 SLA.
Express served Node.js reliably for a decade, but its callback-driven middleware pipeline and mutable HTTP request state become severe liabilities on V8 edge isolates. During a production webhook traffic spike on PingPanda, Express HTTP polyfills caused 240ms p99 cold starts and connection timeouts. Migrating to Hono eliminated 800KB of Node polyfills, dropped p99 cold starts to 8ms, and unlocked compile-time RPC contract verification across our client and edge layers.
At 14:23 UTC on a billing cycle renewal day, PingPanda's webhook processor stalled. Stripe's retry emitter sent 47,000 events in 9 minutes. Our synchronous database handler held PostgreSQL connections open while waiting for Discord API responses. The pool hit its 20-connection ceiling in 6 seconds. Here is exactly what happened and what we replaced it with.
Let's evaluate your technical requirements and outline an execution plan.