Overview
FaunaDB is a serverless, globally distributed NoSQL database designed to support modern application architectures like serverless functions and JAMstack. It provides a flexible document data model and offers both a native GraphQL API and a custom query language, Fauna Query Language (FQL), to interact with data. The service emphasizes strong consistency with ACID transactions, even across its distributed infrastructure, which is a distinguishing feature compared to some other NoSQL databases that prioritize eventual consistency.
FaunaDB is engineered for developers building applications that require low-latency access to data from anywhere in the world, without the operational complexity of managing database servers. Its architecture abstracts away sharding, replication, and scaling, allowing developers to focus on application logic. The database is particularly suited for use cases demanding real-time data updates, such as collaborative applications, gaming backends, and personalized user experiences where immediate data consistency is critical. The transactional guarantees extend to complex operations involving multiple documents or indexes, ensuring data integrity across distributed operations.
The platform's pricing model is consumption-based, scaling with usage of storage, reads, writes, and compute units, making it suitable for applications with variable or unpredictable workloads. This pay-as-you-go approach aligns with the cost models of other serverless components, facilitating predictable billing for serverless deployments. FaunaDB also offers dedicated plans for applications with higher performance or isolation requirements. Compliance certifications like SOC 2 Type II, GDPR, CCPA, and HIPAA are maintained to support enterprise and regulated industry applications, addressing data security and privacy concerns for sensitive workloads.
FaunaDB's developer experience is supported by well-maintained SDKs for popular languages including JavaScript, Go, Python, and Java. The documentation provides clear examples and guides for common use cases, aiding rapid development and integration. The choice between GraphQL and FQL allows developers to select the API that best fits their project's needs and team's expertise. GraphQL offers a familiar interface for many frontend developers, while FQL provides fine-grained control over transactional logic and data manipulation.
Key features
- Globally Distributed Architecture: Data is automatically replicated and distributed across multiple cloud regions, providing low-latency access and high availability worldwide FaunaDB Architecture Overview.
- ACID Transactions: Supports strong consistency with atomicity, consistency, isolation, and durability for all operations, including cross-document and cross-region transactions FaunaDB Transactions.
- Serverless Operation: Managed service requiring no database administration, scaling automatically with demand and billed on a consumption basis Fauna Homepage.
- GraphQL API: Provides a native GraphQL interface for flexible data querying and manipulation, simplifying frontend integration FaunaDB GraphQL API.
- Fauna Query Language (FQL): A powerful, expressive, and declarative query language for complex data operations, business logic, and transactional control Fauna Query Language Reference.
- Document Model: Flexible schema-less document database that stores data as JSON-like documents, allowing for agile schema evolution.
- Multi-Region Support: Enables data locality and resilience by distributing data across multiple geographic regions.
- Compliance and Security: Adheres to compliance standards such as SOC 2 Type II, GDPR, CCPA, and HIPAA, with built-in security features FaunaDB Compliance.
Pricing
FaunaDB offers a free tier for development and a pay-as-you-go model for production usage, based on consumption of storage, reads, writes, and compute units. Dedicated plans are available for higher-scale needs.
| Metric | Free Tier (Monthly) | Pay-as-you-go (per unit) |
|---|---|---|
| Storage | 100 MiB | $0.015 / GiB |
| Read Operations | 100,000 ops | $0.00000018 / op |
| Write Operations | 50,000 ops | $0.00000036 / op |
| Compute Units | 100,000 CUs | $0.00000036 / CU |
| Databases | 1 | Additional databases available on paid tiers |
Pricing accurate as of May 2026. For the most current details, refer to the official FaunaDB pricing page.
Common integrations
- Serverless Functions: Integrates with AWS Lambda, Google Cloud Functions, Azure Functions, and Cloudflare Workers for database access from serverless backends FaunaDB Serverless Integrations.
- JAMstack Frameworks: Commonly used with Next.js, Nuxt.js, Gatsby, and Eleventy for dynamic data in static site generators FaunaDB JAMstack Integrations.
- GraphQL Clients: Works with Apollo Client, Relay, and other GraphQL libraries for frontend data management.
- Authentication Services: Can be integrated with Auth0, Clerk, or Firebase Authentication for user management and secure data access.
- Vercel and Netlify: Direct integrations for deploying JAMstack applications with FaunaDB as the backend Vercel Fauna Integration.
Alternatives
- MongoDB Atlas: A fully managed cloud database service offering MongoDB, a popular document database, with flexible deployment options.
- Amazon DynamoDB: AWS's proprietary serverless NoSQL key-value and document database, known for its scalability and performance at any scale.
- CockroachDB: A distributed SQL database designed for global scale, strong consistency, and high availability, offering a SQL interface.
- Google Cloud Firestore: A serverless document database for mobile, web, and server development from Google Cloud, offering real-time synchronization and offline support.
- Azure Cosmos DB: Microsoft Azure's globally distributed, multi-model database service, supporting various APIs including SQL, MongoDB, Cassandra, and Gremlin.
Getting started
To get started with FaunaDB, you typically create a database, obtain an API key, and then use one of the FaunaDB SDKs to interact with your data. The following JavaScript example demonstrates how to initialize the client and create a new document in a collection.
const faunadb = require('faunadb');
const q = faunadb.query;
// Replace with your actual FaunaDB secret key
const client = new faunadb.Client({
secret: 'YOUR_FAUNADB_SECRET_KEY'
});
async function createProduct() {
try {
const result = await client.query(
q.Create(
q.Collection('products'),
{
data: {
name: 'FaunaDB T-Shirt',
price: 25.99,
description: 'A comfortable t-shirt featuring the FaunaDB logo.'
}
}
)
);
console.log('Document created successfully:', result.data);
} catch (error) {
console.error('Error creating document:', error);
}
}
createProduct();
This example first imports the FaunaDB JavaScript driver and initializes a client with your secret key. It then defines an asynchronous function createProduct that uses FQL to create a new document in a collection named products. The q.Create() function is used to specify the collection and the data for the new document. The result, including the document's reference and data, is logged upon successful creation. Error handling is included to catch and report any issues during the database operation. Before running this code, ensure you have Node.js installed and the faunadb package added to your project dependencies by running npm install faunadb.