Fireship · @fireship
FaunaDB Basics - The Database of your Dreams
Uploaded October 15, 2020 · Length 16:36
Summary
Learn FaunaDB basics, a cloud database that's serverless, scalable, and easy to use, and build a simple REST API with Express to interact with it.
- faunadb basics
- serverless database
- fauna db tutorial
- fauna db rest api
- express faunadb
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
when you build an app one of the main
- 0:01
pain points that you'll face is your
- 0:02
database
- 0:03
you often hear developers debate the
- 0:05
merits of sql versus nosql
- 0:07
on one hand you have safety security and
- 0:09
consistency and on the other you have
- 0:11
flexibility scalability and productivity
- 0:13
but what if there's a database that
- 0:15
could put an end to this debate once and
- 0:16
for all
- 0:17
fauna db is the cloud database that i've
- 0:19
always dreamed of
- 0:20
it's entirely serverless so we don't
- 0:21
have to provision anything and we only
- 0:23
pay for what we actually use beyond the
- 0:24
free tier
- 0:25
it's as easy to use as a document
- 0:27
database and you can manage your data
- 0:29
from its web interface
- 0:30
or the command line it's extremely fast
- 0:32
and scales infinitely in the cloud
- 0:33
and is the first database in the world
- 0:35
to implement the calvin model for
- 0:36
partition database systems most
- 0:38
importantly though is its ability to
- 0:40
handle complex data modeling use cases
- 0:42
like the ones you would find in a
- 0:43
relational graph or time series database
- 0:46
over the next few minutes you'll learn
- 0:47
everything you need to know to get up
- 0:49
and running with fonodb
- 0:50
we'll use it to model the data
- 0:51
relationships that you would find on
- 0:53
twitter
- 0:53
a user has many tweets users can follow
- 0:56
each other and retrieve a feed of tweets
- 0:57
from all the users that they follow
- 0:59
we'll write our code in node.js
- 1:00
and by the end of the video you'll have
- 1:02
an api that you can use to connect to
- 1:04
your frontend application
- 1:05
if you're new here like and subscribe
- 1:06
and check out the full write-up on
- 1:08
fireship io
- 1:09
to follow along today the first thing
- 1:10
you'll need is a free fauna account
- 1:12
once logged in you'll see the fauna
- 1:14
dashboard at this point you won't have a
- 1:15
database
- 1:16
so go ahead and click the button to
- 1:17
create a new one this is what's known as
- 1:19
a top level database
- 1:20
and an awesome thing about fauna is that
- 1:22
it supports multi-tenancy it's beyond
- 1:24
the scope of this video but a cool
- 1:25
feature you should know about a database
- 1:27
can have an unlimited number of child
- 1:28
databases
- 1:29
allowing you to scope data and
- 1:31
privileges to a specific organization or
- 1:33
team
- 1:33
in most cases though you'll just need
- 1:35
one single database for your entire
- 1:36
application
- 1:37
now that we have a database we'll create
- 1:39
a collection a collection is like an sql
- 1:41
table
- 1:42
and works very similar to other
- 1:43
document-oriented databases like mongodb
- 1:46
or firestore a collection is kind of
- 1:48
like a folder that contains many
- 1:49
documents
- 1:50
then you can make queries against that
- 1:51
collection to filter out a set of
- 1:53
documents that you need for your
- 1:54
frontend ui
- 1:55
when you create a collection you give it
- 1:57
a name which is usually plural and in
- 1:59
our case it will store all of our user


