What is FaunaDB?
FaunaDB is a globally-distributed, serverless, cloud database management system for modern applications, such as those based on JAMstack. It enables you to instantly create a full-featured data backend for applications, in seconds. Just sign up and query!
FaunaDB transforms the traditional DBMS into a Data API that gives you all of the capabilities of an old-guard database, without sacrificing flexibility, scale, and performance. FaunaDB core functions are inspired by Calvin: a clock-less, strictly-serializable transactional protocol for multi-region environments.
Highlights include:
-
Multiple models to manipulate your data (relational, document, and graph).
-
Multiple APIs for data access, including native GraphQL and a DSL-like functional query language, for more productive development.
-
Strong data consistency with isolation levels ranging from snapshot to strict serializability.
-
Built-in auth and key-based security, on by default, that prevents inadvertent data leaks.
-
Built-in multi-tenancy with dynamic QoS.
-
Change data capture, with data temporality, that allows you to track the evolution of your data.
FaunaDB operates as a multi-cloud database service that spans AWS and GCP, across global regions for added reliability and redundancy.
See our Quick start with FaunaDB guide to get started.
What does the modern database look like?
The answer to the above question differs depending on who you ask:
|
|
|
FaunaDB checks all these boxes and offers more.
How does FaunaDB address these requirements?
FaunaDB is the world’s first Calvin-inspired database system. The Calvin paper, was published at Yale University in 2012 by Dr. Daniel Abadi and his team of researchers, Thomson, Ren, Diamond et. al.
Calvin is a practical transaction scheduling and data replication layer that uses a deterministic ordering guarantee to significantly reduce the normally-prohibitive contention costs associated with distributed transactions. Unlike previous deterministic database system prototypes, Calvin supports disk-based storage, scales near-linearly on a cluster of commodity machines, and has no single point of failure. By replicating transaction inputs rather than effects, Calvin is also able to support multiple consistency levels—including Paxos-based strong consistency across geographically-distant replicas—at no cost to transactional throughput.
Unlike other distributed transaction protocols like Spanner and Percolator, Calvin, and FaunaDB, do not rely on physical clock synchronization to maintain consistency. FaunaDB also places no constraints on replica distance, and is practical to deploy at global internet latencies.
What does this mean for a database? Calvin offers the best approach for architecting a distributed transaction engine that operates in highly distributed and unreliable environments such as the Cloud. FaunaDB delivers strong consistency, at scale, across regions, without suffering from issues related to clocks or distance, and does so without requiring specialized hardware, software, or networks to operate your database.
Calvin’s clockless transaction ordering provides several technical benefits that translate to unique benefits in different use cases:
Calvin capability | Benefit | Use Case Examples |
---|---|---|
Strictly serializable, multi-region transactions. |
Provides a consistent, unified, and global view of all data in real time. |
Global backend for operational SaaS or mobile apps. |
Single round consensus for writes. |
Lower write latency that is not impacted by multiple round trips across different regions. |
Transactional mobile and payment apps where a snappy user experience matters. |
Write serializability independent of the number of keys. |
Unlike some of our competitors, FaunaDB does not have any restrictions on the number of keys that can be part of a transaction. There is no need to artificially split transactions into multiple batches of keys. |
Games or business applications where a transaction can impact multiple keys. |
Serializable reads can be serviced by any replica. |
Reads can be serviced by any region. Results in real-time visibility that provides an accurate view to the end user. |
Location-based mobile apps that require low-latency, consistent reads, irrespective of geography. |
No contention between serializable writes and reads. |
Leads to lower latency writes and a consistent view of data across the globe. |
Real-time business apps that feature consolidation of data across the globe. |
Architectural innovations at every layer
While Calvin is at the heart of FaunaDB’s transaction protocol, there are innovations in other important components of the database as well.
Data model
FaunaDB implements a semi-structured, schema-free, object-relational data model, a strict superset of the relational, document, object-oriented, and graph paradigms. The data model allows enforcing constraints, creating indexes, and joining across multiple document entities. Objects within FaunaDB can be visualized as the following hierarchy.
-
Records are inserted as semi-structured documents, which can include recursively-nested objects and arrays, as well as scalar types.
-
Documents are grouped into collections, which are similar to tables in relational databases.
-
Collections are further grouped into databases. Like file system directories, databases can recursively contain other databases.
Derived relations are built with indexes. An index is a transformation of a set of input instances into one or more result sets composed of terms and values. Indexes are expressed as partially-applied queries and can transform, cover, order their inputs, and enforce constraints.
Query interface
FaunaDB offers polyglot APIs that includes native GraphQL capabilities, as well as a proprietary, functional query language (called FQL) for advanced tasks. Interaction with the database is mediated by drivers that publish embedded DSLs for popular application languages. Developers using FaunaDB write application-native code in a familiar style, within a transaction context. A single request can encapsulate a transaction that spans multiple records.
Clustering
The use of Calvin also allows FaunaDB to implement a master-less architecture. With replicas in a cluster, geographically distributed across many locations, FaunaDB provides Active-Active transactions that allow applications to scale horizontally across the globe without a single line of code.
Security
Most databases implement schema-level user authentication only, since they were designed for small numbers of internal business users. But modern applications are exposed to millions of untrusted and potentially malicious actors, and must implement identity management, authentication, and row-level security, at a minimum.
FaunaDB internalizes these concerns and provides both administrative and application-level identity and security, either through API servers, or directly to untrusted clients like mobile, browser, and embedded applications.
Next steps
Now that you know something about what FaunaDB is about, you should sign up for a free account and take FaunaDB for a spin! See the Quick start with FaunaDB for details.
There is much more to learn about FaunaDB:
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
documentation@fauna.com
Thank you for your feedback!