1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    An Introduction to FaunaDB

    Chris BiscardiChris Biscardi
    faunadbFaunaDB

    FaunaDB is a Calvin inspired hosted database marketed towards JAMStack and serverless users. It is geo-replicated across multiple providers (AWS, GCP, and soon Azure), uses a lambda calculus based query language (FQL) or the built-in GraphQL support, and is quick to get started with. Don't worry about the vocabulary here (Consistency, lambda calculus, etc), FaunaDB can be quickly put to work without reading any papers and without knowing what lambda calculus is.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: Fauna is billed as a globally distributed, serverless cloud database management system for modern applications like those in the JAMstack. What this means is that FaunaDB is a document store with a Lambda calculus-based query language called FQL and native GraphQL support.

    It is similar to Spanner and inspired by Calvin, both of which have papers written about them that have been cited hundreds of times. However, if words like lambda calculus and reading papers aren't your jam, don't worry. Getting started is easier than it sounds. You won't have to read the papers or take a course in lambda calculus to put FaunaDB to work quickly.

    Practically, what this means is that you can quickly spin up a new database, offload operations to the Fauna team, describe databases using the built-in GraphQL support, and access your data from anywhere around the world quickly without sacrificing correctness constraints.

    FaunaDB is multi-tenant by default, which means it supports nested databases. It operates as a multi-cloud service that crosses providers like AWS and GCP in multiple global regions. All of this is done for you without having to give up transactions. You can use FaunaDB from an array of popular languages such as JavaScript or Go.

    Fauna internalizes security in a way that some other databases do not, including intentional support for multi-tenant SaaS services. This support includes different token access levels like read-only, as well as access control lists, or ACLs, that are flexible enough to implement role-based access control, or RBAC, on the document level.

    If you're interested in the deeper correctness constraints offered by FaunaDB, take a look at the Jepsen analysis. If you haven't seen a Jepsen analysis before, note that one of the best outcomes is that the analysis finds issues and the company or project acknowledges and solves them.

    Depending on how you use FaunaDB, you can achieve snapshot isolation levels of serializability or strictly serializable. That puts FaunaDB somewhere between snapshot isolation and strictly serializable on this consistency chart.

    If you're unfamiliar with consistency models, this matters because snapshot isolation guarantees order within a transaction but not across transactions, as the sub-operations may interleave with each other. Strictly serializable systems enforce a total order on the transactions in the system.

    In contrast, weaker consistency models, like read uncommitted, allow one process -- we'll call it A -- to write a record to the database. When process B tries to read the same record, the value process B gets isn't guaranteed to be the original or modified value, and thus, as you can imagine, can easily source bugs.