DEV Community

Joachim Zeelmaekers
Joachim Zeelmaekers

Posted on • Edited on

6

Implement a free no-effort database for your next side-project.

Ever wanted to start a side-project where you needed a database?

Of course, everyone has. Most of the time, when we are trying out a new framework or language, one of the key things is data.

In this short example, you will notice how easy it is to create a secure database which can be accessed via a simple and straight forward Javascript SDK. The service we will be using is named Fauna.

So what is Fauna?

Fauna is a data API which creates a global data store for your application in a couple of minutes. The database has GraphQL support. Using FaunaDB will help you focus on your application and will handle scaling, sharding, provisioning, latency and correctness for you and maybe the most important part, it has a free tier!

How to set up your database

  1. Create an account at Fauna.
  2. Press new database.
  3. Choose a database name.
  4. (optional) toggle the Pre-populate with demo data toggle.
  5. Go to the security tab and create a new key.
  6. Secure the secret in a separate file (we will use this secret).

Code time already?

Yes! As you can see, there were 6 simple steps to create a data API for our application. Now we can start using the faunaDB javascript client.

In the code snippet below you can find a simple example of fetching a User object from the user collection by id.

index.js
code

config.js
key

Interesting links

  1. Source code on Github.
  2. FaunaDB.
  3. Plugin for the code snippets from VS code Polacode

Consider using this service in your next side project and let me know your thoughts on FaunaDB.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay