Fireship · @fireship

FaunaDB Basics - The Database of your Dreams

Uploaded October 15, 2020 · Length 16:36

FaunaDB Basics - The Database of your Dreams

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.

  1. 0:00

    when you build an app one of the main

  2. 0:01

    pain points that you'll face is your

  3. 0:02

    database

  4. 0:03

    you often hear developers debate the

  5. 0:05

    merits of sql versus nosql

  6. 0:07

    on one hand you have safety security and

  7. 0:09

    consistency and on the other you have

  8. 0:11

    flexibility scalability and productivity

  9. 0:13

    but what if there's a database that

  10. 0:15

    could put an end to this debate once and

  11. 0:16

    for all

  12. 0:17

    fauna db is the cloud database that i've

  13. 0:19

    always dreamed of

  14. 0:20

    it's entirely serverless so we don't

  15. 0:21

    have to provision anything and we only

  16. 0:23

    pay for what we actually use beyond the

  17. 0:24

    free tier

  18. 0:25

    it's as easy to use as a document

  19. 0:27

    database and you can manage your data

  20. 0:29

    from its web interface

  21. 0:30

    or the command line it's extremely fast

  22. 0:32

    and scales infinitely in the cloud

  23. 0:33

    and is the first database in the world

  24. 0:35

    to implement the calvin model for

  25. 0:36

    partition database systems most

  26. 0:38

    importantly though is its ability to

  27. 0:40

    handle complex data modeling use cases

  28. 0:42

    like the ones you would find in a

  29. 0:43

    relational graph or time series database

  30. 0:46

    over the next few minutes you'll learn

  31. 0:47

    everything you need to know to get up

  32. 0:49

    and running with fonodb

  33. 0:50

    we'll use it to model the data

  34. 0:51

    relationships that you would find on

  35. 0:53

    twitter

  36. 0:53

    a user has many tweets users can follow

  37. 0:56

    each other and retrieve a feed of tweets

  38. 0:57

    from all the users that they follow

  39. 0:59

    we'll write our code in node.js

  40. 1:00

    and by the end of the video you'll have

  41. 1:02

    an api that you can use to connect to

  42. 1:04

    your frontend application

  43. 1:05

    if you're new here like and subscribe

  44. 1:06

    and check out the full write-up on

  45. 1:08

    fireship io

  46. 1:09

    to follow along today the first thing

  47. 1:10

    you'll need is a free fauna account

  48. 1:12

    once logged in you'll see the fauna

  49. 1:14

    dashboard at this point you won't have a

  50. 1:15

    database

  51. 1:16

    so go ahead and click the button to

  52. 1:17

    create a new one this is what's known as

  53. 1:19

    a top level database

  54. 1:20

    and an awesome thing about fauna is that

  55. 1:22

    it supports multi-tenancy it's beyond

  56. 1:24

    the scope of this video but a cool

  57. 1:25

    feature you should know about a database

  58. 1:27

    can have an unlimited number of child

  59. 1:28

    databases

  60. 1:29

    allowing you to scope data and

  61. 1:31

    privileges to a specific organization or

  62. 1:33

    team

  63. 1:33

    in most cases though you'll just need

  64. 1:35

    one single database for your entire

  65. 1:36

    application

  66. 1:37

    now that we have a database we'll create

  67. 1:39

    a collection a collection is like an sql

  68. 1:41

    table

  69. 1:42

    and works very similar to other

  70. 1:43

    document-oriented databases like mongodb

  71. 1:46

    or firestore a collection is kind of

  72. 1:48

    like a folder that contains many

  73. 1:49

    documents

  74. 1:50

    then you can make queries against that

  75. 1:51

    collection to filter out a set of

  76. 1:53

    documents that you need for your

  77. 1:54

    frontend ui

  78. 1:55

    when you create a collection you give it

  79. 1:57

    a name which is usually plural and in

  80. 1:59

    our case it will store all of our user