Catalogue / fly-2025-tkdb-token-service

Fly.io keeps Macaroon token secrets in tkdb, a small Go service over replicated SQLite, apart from its main API

Fly.io, 2025. Tkdb, the Macaroon token database and verification service.

Organisation
Fly.io
Evidence
Reported from production
Source
Operationalizing Macaroons

Fly.io blog, published 2025-03-27

Records

Decision#d1

Put token secrets and verification in a separate, deliberately simple service, not in the main API cluster

Decision#d2

Store token data in SQLite replicated by LiteFS, with one primary and read copies on two other continents

Decision#d3

Secure the token service's RPC with the Noise protocol instead of trusting the message bus it ran over

Decision#d4

Cache token verifications in every client and invalidate by polling a revocation feed

Decision#d5

Replace the NATS transport to the token service with HTTP and keep the Noise channel inside it

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.