Is Fauna The Next Big Database Technology?

Simon Pfeiffer - Apr 15 '22 - - Dev Community

If you call yourself a builder, whether that means working on a startup, open source, or personal projects, you need to keep up to date with the latest tech. Innovation in software development is only accelerating, with paradigm shifts happening more and more often.

In the world of Databases, Fauna has generated a lot of buzz by creating one of the most versatile, scalable, and intuitive database technologies out there.

Today, we’ll explore how Fauna works and create and use our first Fauna database.


What is Fauna?

Fauna is a serverless, multi-region database that is accessible through a cloud API. That means that Creating, Reading, Updating and Deleting data can all be done within a standard api call.

For the more technically minded, Fauna is what’s called a transactional database. In layman’s terms, this means that you can get the flexibility of a noSQL database like Mongo, without sacrificing the speed and accuracy you get from a SQL Database.

This makes Fauna an amazing option for startups and personal projects that want to build quickly without incurring a ton of technical debt.


Creating a Fauna Account

To get started, first visit the signup page and create a free fauna account. This will direct the user to the fauna dashboard.

Image description

Click on CREATE DATABASE to create a database. Next, provide the database name and the region where the database will be created.

Image description

We will need the access key to interact with the database. Navigate to the security section from the database view. Here, you can create the access key that will be used to communicate with the Fauna API.

Image description


Integrating Fauna with an Application

Now that we have created a Fauna database and obtained the access key, we can utilize Fauna in an application. In this section, we will look at how we can communicate with Fauna using Python. Of course, since this is all API based, implementations will be nearly identical in every language.

Let’s first setup a python environment with:

pipenv shell

Image description

Now let’s install the dependencies. This is the Python driver for Fauna.

Pipenv install faunadb

Image description


Create the Application

In the following code, we connect to our database and perform all four CRUD operations that we expect from a database:

  • Create
  • Read
  • Update
  • Delete

If the program is successfully executed, you should see the following output for each respective function:

Image description

Image description

Image description

Image description

Image description


There you have it! We’ve setup our own Fauna project and performed all the standard database technologies in less than 100 lines of code. The simplicity of this implementation isn’t a result of us cutting corners – it’s actually that easy!

So what do you think? Are you going to be using Fauna for your next project? Let us know down below!

Happy coding from your good friends at Codesphere, the Swiss army knife every software developer needs.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player