SUB-MILLISECOND WIRE SPEED

Transparent GraphQL CQRS for Distributed Microservices

Built on Pingora—Cloudflare's core proxy platform—SpectraGQL inspects GraphQL at the edge, reverse-proxies read queries to upstream services, and re-routes write mutations into industry-standard event logs to power eventually consistent event-sourced microservices.

Hot-Path Performance Invariants

Optimized for Wire-Speed Line Rate

Every microsecond and heap allocation on the request/dispatch hot path matters. SpectraGQL is relentlessly engineered to avoid locks and eliminate thread contention at wire speed.

P99.9 Receipt Latency
< 1 ms

Sub-Millisecond Edge Latency

Mode B mutation termination with deterministic UUIDv7 & HLC timestamps

Ops / Sec / Node
100k+

Wire-Speed Throughput

Async non-blocking Pingora event loop handling millions of concurrent streams

Hot-Path Re-allocations
0

Zero Alloc Hot Path

Zero redundant JSON deserialization and lock-free atomic latency metrics

Operational Footprint
< 25 MB

Ultra-Lean Appliance

Compiled native Rust with minimal idle memory overhead and zero GC pauses

Broker-First & Framework-Agnostic

Uses Your Existing Event Infrastructure

SpectraGQL streams write mutations into durable logs at edge velocity without RPC bottlenecks. Bring Your Own Workers (BYOW) in Go, Node.js, Python, or Rust.

Primary reference sink with ephemeral inboxes, consumer lag tracking, and sub-millisecond publish.

Status: published beta

High-watermark partition streaming with zero-allocation gateway record dispatch.

Status: published alpha

Zero-copy append-only sequential stream over TCP and QUIC built in Rust.

Status: published alpha

Low-latency append-only streams with consumer groups (XADD, XREADGROUP, XPENDING).

Status: published alpha
Don't have your own worker?Check out SpectraFlux— our high-velocity WebAssembly worker chassis and execution appliance.

Anatomy of a Wire-Speed Mutation

How SpectraGQL Routes Mutations

See how incoming GraphQL mutations are classified, split into sub-millisecond receipts, and streamed into append-only event logs.

STAGE 1 • POST /graphqlSwipe ↔

GraphQL Mode B Mutation

The client dispatches standard GraphQL over HTTP/2. SpectraGQL breaks down the request into its constituent protocol components without executing heavyweight ORM layers:

Authorization & Claims
Cryptographically verified via bounded L1 cache; claims injected into trace headers.
AST Selection Set
Identifies the mutation field updateAddress and receipt return shape: { receiptId, status, timestamp }.
Variables Payload
Parsed once by protocol decoder and preserved as a borrowed byte slice for zero-allocation broker dispatch.
GraphQL Mutation Requestgraphql
mutation MovedAddress($userId: ID!, $street: String!, $city: String!) {
  updateAddress(userId: $userId, street: $street, city: $city) {
    receiptId
    status
    timestamp
  }
}
1 of 4

Edge Security & Policy Pipeline

Interceptors & AuthN / AuthZ

Evaluate authentication, RBAC policies, and custom WebAssembly hooks before mutations reach downstream workers or upstream services—with zero locks and microsecond edge execution.

Interceptors: Google CEL & WebAssembly

Two complementary approaches to reject, sanitize, obfuscate, or decorate requests at wire speed

Request / Response Hooks

SpectraGQL provides two complementary execution tiers for edge request and response manipulation: Google Common Expression Language (CEL) for lightweight, declarative boolean checks, and WebAssembly (WASM) guest plugins when dynamic state, external cryptographic hashing, or full payload transformations are required.

Google CEL (Zero-Allocation Rules)

Fast Path (<5µs)

Best for fast declarative expressions evaluating headers, client IP, GraphQL operation names, and mutation variable predicates without compiling or bundling guest binaries.

[interceptors.auth_guard]
stage = "request"
type = "cel"
expr = """
  'authorization' in request.headers
  && request.headers['authorization'].startsWith('Bearer ')
"""

[interceptors.leak_guard]
stage = "response"
type = "cel"
expr = "!body.contains('internal_secret_key')"

WASM Plugins (Deep Transformations)

Turing-Complete Sandbox

CEL is intentionally constrained to pure predicates. When you need to rewrite JSON payloads, sanitize PII, obfuscate credit cards, compute dynamic signatures, or enforce stateful token buckets, WASM plugins execute in sandboxed memory with epoch-tick execution limits and circuit-breaker fail-safes.

[interceptors.pii_scrubber]
stage = "response"
type = "wasm"
module = "modules/scrubber.cwasm"
function = "scrub_response"
timeout_ms = 5
fail_mode = "fail_closed"
circuit_breaker_failures = 5

Works with Third-Party Standards-Based AuthN Providers

AuthN / AuthZ Guard

Declarative RBAC and universal OIDC / JWKS with zero-copy cryptographic token verification using a bounded LRU cache (10,000 entries). Automatically maps JWT/OIDC roles from standard identity providers (e.g. Clerk, Auth0, Keycloak) to permitted GraphQL operations with configurable unauthenticated operation bypass.

[interceptors.rbac_guard]
stage = "request"
type = "rbac"
jwks_url = "https://auth.company.com/.well-known/jwks.json"
mutations_default = "deny_unlisted"
unauthenticated_ops = ["IntrospectionQuery", "login"]

[interceptors.rbac_guard.roles]
admin = ["*"]
editor = ["updateAddress", "confirmOrder"]
viewer = ["getProfile"]

Full Security Auditing: Accepted & Rejected Mutations

Dual-Ingress Audit Tap

Security auditing applies to both accepted mutations and rejected attempts. Capture malicious or invalid traffic in real time without passing load upstream, and stream accepted mutation audit trails with monotonic UUIDv7 IDs and HLC timestamps for security tweaking and compliance. Can be run in DX audit_only mode, active enforcement, or disabled in production.

// Published broker audit stream
{
  "id": "018f6c91-b3b2-7000-8480-1c6e11516001",
  "topic": "interceptors.audit.updateaddress",
  "type": "com.spectragql.interceptor.audit",
  "status": "ACCEPTED", // or "REJECTED" (e.g. RBAC_FORBIDDEN, 403)
  "audit_tag": "SECURITY_POLICY_PASSED",
  "hlc": "1774136400000000000-0001",
  "client_ip": "198.51.100.42"
}

Zero-Overhead Edge Telemetry

Domain-Level Observability

Administrative inspection and telemetry APIs (/admin/*) run entirely out-of-band on dedicated worker loops—delivering live GraphQL mutation traces, causal command verification, and broker consumer lag tracking with 0 mutex locks on edge client traffic.

Native Lag TelemetrySpectraGQL Admin Console • Out-of-Band • 0 Mutexes

Zero-Touch Broker Discovery & Consumer Lag Inspection

SpectraGQL queries broker ground truth directly out-of-band on dedicated background worker loops. Inspect real-time stream message depth, sequence numbers, consumer pending lag (num_pending), unacknowledged inboxes (num_ack_pending), and connected downstream worker appliances like SpectraFlux—with zero custom worker SDKs and 0 mutex locks on edge client traffic.

Zero Worker SDKs

Downstream BYOW workers in Go, Node.js, Python, or Rust subscribe directly to broker topics without embedding proprietary gateway agent libraries.

Broker Ground Truth

Direct out-of-band inspection of NATS JetStream consumer info (num_pending, num_ack_pending), Kafka high-watermarks, and Redis XPENDING offsets.

SpectraFlux Integration

Live tracking of active consumer groups and downstream worker engines—including companion SpectraFlux WebAssembly chassis appliances.

spectragql.internal:8000/adminLIVE
Click thumbnail to inspect full console
1 of 3

FAQ

Frequently Asked Questions

Core architecture, Mode B edge termination, and event sink compatibility.

SpectraGQL is an ultra-high-performance wire-speed API gateway and event-driven appliance built in Rust on Cloudflare's Pingora engine.

It provides a pragmatic dual-path CQRS architecture:

  • Mode A (Read Queries): Reverse-proxies GraphQL queries and REST reads directly to upstream services with connection pooling, retries, and passive telemetry.
  • Mode B (Write Mutations): Routes mutations through either SyncUpstream (drop-in proxying while tapping broker events) or AsyncCommand (sub-millisecond edge command receipts).

SpectraGQL routes write mutations through two flexible modes so organizations can adopt CQRS progressively without risky rewrites:

  • AsyncCommand: The gateway terminates mutations at the edge, immediately issuing a deterministic Command Receipt (<1ms HTTP 200 ACCEPTED) with a monotonic UUIDv7 ID and Hybrid Logical Clock (HLC) timestamp while dispatching the payload into an append-only event stream.
  • SyncUpstream: Mutations are synchronously proxied to your existing service while simultaneously and transparently tapping the event into the broker—allowing organizations to adopt CQRS incrementally without rewriting existing code.

SpectraGQL streams mutations directly into your existing append-only event infrastructure out of the box with zero bespoke RPC overhead:

  • NATS JetStream (Published Beta): Primary reference implementation with ephemeral inboxes and consumer lag tracking.
  • Apache Kafka & Redpanda (Published Alpha): Enterprise partition streaming with high-watermark inspection.
  • Apache Iggy (Published Alpha): Zero-copy streaming in Rust over TCP/QUIC.
  • Valkey / Redis Streams (Published Alpha): In-memory append-only stream buffers with consumer groups (XREADGROUP).

Downstream write handlers follow a Bring-Your-Own-Worker (BYOW) approach:

  • Zero Gateway SDKs: Microservices, background workers, or workflows written in Go, Node.js, Python, or Rust consume standard CNCF CloudEvents directly from broker consumer groups.
  • Zero Reverse Ports: Workers do not require open HTTP ports or reverse network connectivity to the gateway.
  • Broker Ground Truth: SpectraGQL inspects consumer group lag and high-watermarks directly from broker metrics out-of-band.
  • Don't Have Your Own Worker? Check out SpectraFlux—our high-velocity WebAssembly worker chassis and execution appliance built specifically to consume event sinks and process reactive CQRS workflows out of the box.

SpectraGQL is built for universal compatibility with standard identity protocols:

  • Universal OIDC & JWKS: Validates JSON Web Tokens (JWT) at line-rate from any identity provider conforming to RFC 7519 / OpenID Connect—including Okta, Auth0, Supabase, AWS Cognito, Clerk, Keycloak, and Firebase.
  • Zero-Allocation Token Caching: Cryptographically verified tokens and claims are cached in a high-speed bounded L1 LRU cache (10,000 capacity), eliminating redundant signature verifications on subsequent requests.
  • Declarative RBAC & ABAC: Express authorization policies natively in configuration or evaluated at wire speed with Common Expression Language (CEL) rules without invoking upstream services.
  • Looking for Passwordless Out of the Box? Check out SpectraFlux, which includes a pre-packaged MagicLink AuthN fluxcell. It handles secure one-time password (OTP) email authentication, token generation, and session caching out of the box with zero boilerplate.

SpectraGQL enforces strict zero-bloat invariants on the request/dispatch hot path:

  • Zero Redundant Deserialization: Reuses pre-parsed AST tokens and JSON payloads from the protocol decoder.
  • Zero Edge Formatting: Never pretty-prints JSON or indents whitespace on worker threads.
  • Lock-Free Atomics: Eliminates mutex locks on metrics, latency counters, and circular traffic buffers to prevent thread contention.
  • Strictly Out-of-Band Admin APIs: Inspection endpoints (/admin/*) execute out-of-band and introduce zero branching into user traffic.
100% Free & Open Source

Try SpectraGQL today

SpectraGQL terminates GraphQL mutations at the gateway edge in sub-millisecond latency. Zero allocation on the hot path, lock-free atomics, and broker-agnostic event sourcing.