Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

🛡️ ATRI: Enterprise Webhook Proxy LayerAn ultra-high-performance, zero-data-loss webhook recovery reverse proxy engineered entirely in C++20.ATRI is designed for modern development teams, fintech startups, and e-commerce platforms that require full data sovereignty, sub-millisecond latency, and commercial-grade reliability without relying on expensive, cloud-dependent infrastructure (like Hookdeck or Svix). It sits directly at your network edge, ingesting traffic and shielding your core backend from webhook drops, upstream timeouts, and sudden traffic spikes.🔥 Core Technical Architecture⚡ Sub-0.5ms Ingestion Latency: Built on a Linux io_uring asynchronous backend and a lock-free MPMC ring buffer (Vyukov queue discipline). It safely ingests payloads and returns an HTTP 200 OK ACK instantly, long before your heavy backend even touches the data.💾 Crash-Safe Write-Ahead Log (WAL): Custom WAL serialization backed by CRC32C integrity checksums and strict fdatasync() enforcement. If the container or host crashes abruptly (e.g., kill -9), all pending events are perfectly reconstructed upon the next startup.🧠 Two-Tier Deduplication Engine: A lock-free Bloom filter acts as an ultra-fast initial gate, backed by a bounded LRU map. This ensures strict idempotency—your backend will never process the same webhook twice.🔐 Native Multi-Provider HMAC Verification: Implements constant-time cryptographic signature validation (CRYPTO_memcmp) natively for Stripe, Razorpay, and Shopify. This neutralizes timing side-channel attacks at the proxy level.🛡️ Advanced Resilience & Recovery: Features a highly tuned exponential backoff algorithm with full jitter, a 3-state circuit breaker (CLOSED → OPEN → HALF_OPEN) with EWMA health scoring, and a fully functional Dead Letter Queue (DLQ).🚀 Step-by-Step Deployment GuideDeploying ATRI is seamless. It requires zero code intrusion into your existing codebase. Follow these steps to spin up the edge layer in under 5 minutes.Step 1: Pull the Official Runtime ImageFirst, fetch the lightweight, stripped, non-root Docker image directly from the GitHub Container Registry (GHCR):docker pull ghcr.io/ayushbiswas2011/atri-proxy:latest Step 2: Configure and Spin Up the Edge LayerStart the ATRI container. This command binds the proxy to port 8080, injects your production license key, and points to the authentication edge URL.Run the following command in your terminal:docker run -d
--name atri-core-proxy
--restart unless-stopped
-p 8080:8080
-e ATRI_LICENSE_KEY="ayush"
-e ATRI_LICENSE_URL="https://atri-ui-ux-design.vercel.app/api/verify"
ghcr.io/ayushbiswas2011/atri-proxy:latest Step 3: Verify Container InitializationYou must ensure that the proxy has booted successfully, established communication with the upstream handler, and activated its memory guards.Monitor the live runtime engine logs by running:docker logs -f atri-core-proxy What to look for: Look for logs indicating an initialization status of ok or tier: scale / unrestricted. This confirms that the scaling pipeline is active and the proxy is ready to accept traffic.📋 Environment Variable ReferenceCustomize the behavior of your proxy layer by passing these variables inside your Docker deployment script or .env file:VariableRequiredValueDescriptionATRI_LICENSE_KEY✅ayushThe unique production signature key used for local payload validation and tier unlocking.ATRI_LICENSE_URL✅https://atri-ui-ux-design.vercel.app/api/verifyThe global serverless callback URI located on the Vercel network edge.💻 Developer Integration: How to Use ATRIOnce the ATRI container is running on your infrastructure, integrating it into your existing system is completely non-intrusive. No SDKs or middleware are required.1. Re-Route Your WebhooksCurrently, providers (Stripe, Shopify, Razorpay) send webhooks directly to your API (e.g., api.yourdomain.com/webhooks).Instead, configure your providers to send webhooks to ATRI's listener URL:http://:8080/v1/webhooks 2. How the High-Speed Pipeline WorksInstant ACK: When Stripe hits the URL above, ATRI’s lock-free MPMC queue ingests the payload, writes it safely to the local WAL, and instantly drops an HTTP 200 OK back to Stripe (in under 0.5ms). Stripe marks the webhook as successfully delivered immediately.Proxy Forwarding: ATRI then takes over the responsibility of asynchronously forwarding that payload to your actual Node.js/Python/Go backend server.Automatic Retries: If your backend is down, undergoing maintenance, or timing out due to heavy load, ATRI does not drop the payload. It keeps the event in the local SQLite WAL/DLQ stack and automatically retries using exponential backoff.3. Local Administration via CLI (atrictl)ATRI comes with a built-in control plane CLI tool inside the container. You can manage the proxy engine, check internal metrics, and interact with the Dead Letter Queue natively.Check the runtime health and structural status:docker exec -it atri-core-proxy atrictl status Force replay all events currently stored inside the Dead Letter Queue (DLQ):docker exec -it atri-core-proxy atrictl replay-all 🔒 Security & FootprintZero Data Egress: Unlike SaaS webhook providers, all webhook payloads processed by ATRI remain strictly inside your host infrastructure. This guarantees native GDPR, HIPAA, and data residency compliance.Hardened Image: The proxy runs as a non-root user (UID 65534) on a minimal ~60MB Docker layer, optimized for ultra-low resource utilization even during massive traffic spikes.

About

Production Deployment Guide for ATRI Webhook Proxy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors