Fauna API
Fauna API
Fauna is a serverless distributed ACID database — globally distributed, strongly consistent, FQL query language, hybrid relational + document model.
Globally distributed strong consistency like Spanner
Steep FQL learning curve (proprietary functional syntax)
Sign up at dashboard.fauna.com and create DB for secret. JS SDK: const client = new fauna.Client({secret: "..."}); await client.query(fql`Collection.create({name: "users"})`);
Uptime · 30-day window
About this API
Fauna is a serverless database company founded 2017, positioned as "relational + document hybrid DB for the serverless era". Tech differentiators: (1) Calvin protocol — distributed ACID based on academic research, providing globally strong consistency (Spanner-like) but serverless deployment (developers don't manage clusters); (2) FQL (Fauna Query Language) — functional query language (not SQL nor MongoDB), expressive but steep learning curve; (3) GraphQL first-class — declare schema auto-generates GraphQL endpoint. Best for: serverless function (AWS Lambda, Cloudflare Workers, Vercel Functions) backends; apps needing global consistency without setting up Spanner. But FQL learning cost and small-scale pricing make it less popular than Supabase / Firebase. Fauna underwent product adjustments in 2024.
What you can build
- 1Serverless app backend (Lambda / Workers + Fauna)
- 2Need ACID but want serverless flexibility
- 3GraphQL-first dev experience
- 4Multi-tenant SaaS
Strengths & limitations
Strengths
- Globally distributed strong consistency like Spanner
- Serverless (per-query billing)
- GraphQL native (no separate GraphQL layer)
- Powerful FQL query language
Limitations
- Steep FQL learning curve (proprietary functional syntax)
- Smaller ecosystem than Postgres / MongoDB
- Pricing not necessarily worthwhile at small-mid scale
Example request
curl https://fauna.com/<endpoint> \
-H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.Getting started
Sign up at dashboard.fauna.com and create DB for secret. JS SDK: const client = new fauna.Client({secret: "..."}); await client.query(fql`Collection.create({name: "users"})`);
FAQ
Fauna vs. Supabase?+
Need globally strong consistency ACID: Fauna. Postgres ecosystem + standard SQL: Supabase.
Technical details
- Auth type
- api_key
- Pricing
- paid
- Rate limit
- 按 plan
- Protocols
- REST, GraphQL
- SDKs
- javascript, typescript, python, go, java, csharp