Building a serverless, post-quantum Matrix homeserver
Jan 27, 2026Nick Kuntz

Summary
This post details the porting of the Synapse Matrix homeserver to Cloudflare Workers, demonstrating a serverless architecture for a traditionally stateful and operationally heavy application. It maps Synapse's storage requirements (PostgreSQL, Redis, filesystem) to Cloudflare primitives: D1 for event data, KV for ephemeral state like OAuth codes, R2 for media storage, and Durable Objects for atomic operations like E2EE key management and real-time room events. The post also highlights the automatic application of post-quantum TLS (X25519MLKEM768) for all connections to the Worker, and the implementation of a full OAuth 2.0/OIDC provider.