Relay

Technical Journal // Relay
Jul '26

API Design for Backend Systems

A practical, opinionated guide to designing backend APIs. Covers request and response schema, offset and keyset pagination, BFF, server-driven UI, caching, versioning, naming, the new HTTP QUERY verb, WebSocket vs SSE, API security (auth headers, server-to-server auth, webhook receivers), and bulk data load APIs. Built around Relay, the same AI proxy system from the multi-tenant SaaS post, with REST and JSON as the running example and Go code throughout.

Jul '26

How Multi-Tenant SaaS Actually Works

A complete system design of Relay, a multi-tenant AI API gateway. Covers multi-tenant database architecture (silo vs pool vs bridge), API key authentication, provider routing with failover, dual-layer rate limiting, token-based billing, response caching, row-level security, tenant provisioning, and observability. Full Postgres schemas, mermaid diagrams, and Go snippets included.