Fireship · @fireship

MongoDB in 100 Seconds

Uploaded July 14, 2021 · Length 2:27

MongoDB in 100 Seconds

Summary

mongodb basics: document oriented database for scalable workloads

  • mongodb
  • document database
  • nosql database
  • scalability
  • database design

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    mongodb is the world's most advanced and

  2. 0:02

    popular document oriented database it

  3. 0:05

    was created in 2007 after the team at

  4. 0:07

    double click a company serving 400,000

  5. 0:09

    ads per second faced issues with

  6. 0:11

    scalability and flexibility using

  7. 0:13

    existing database systems this inspired

  8. 0:16

    them to design a database where all data

  9. 0:18

    is stored in Json like documents which

  10. 0:20

    are organized into collections where

  11. 0:22

    they can be queried unlike a relational

  12. 0:24

    table a predefined schema for a

  13. 0:26

    collection is optional which allows you

  14. 0:28

    to evolve your data structures rapidly

  15. 0:30

    without running complex database

  16. 0:31

    migrations but more importantly it

  17. 0:33

    allows data that's frequently accessed

  18. 0:35

    together by an app to be stored in the

  19. 0:37

    same place this makes read operations

  20. 0:39

    extremely fast because no joins are

  21. 0:41

    required it's like having a fully

  22. 0:42

    assembled car ready to go as opposed to

  23. 0:45

    joining together a bunch of separate

  24. 0:47

    parts and that also makes the database

  25. 0:48

    much easier to scale horizontally via

  26. 0:51

    sharding unlike relational tables

  27. 0:53

    collections are self-contained making

  28. 0:55

    them much easier to work with in a

  29. 0:56

    distributed system that's why they call

  30. 0:58

    it it's designed for humongous

  31. 1:00

    workloads when you create a new document

  32. 1:02

    in mongodb it's assigned an object ID

  33. 1:05

    that's unique to that collection inside

  34. 1:07

    the document you can Define multiple

  35. 1:09

    Fields where the value might be a

  36. 1:11

    variety of different data types like a

  37. 1:13

    string array object and so on now to

  38. 1:16

    work with your data in any programming

  39. 1:17

    language the query API is used to

  40. 1:19

    perform basic read and write operations

  41. 1:21

    as well as complex queries and

  42. 1:23

    Transformations across the database to

  43. 1:25

    optimize performance secondary indexes

  44. 1:27

    can be created to make common queries

  45. 1:29

    extreme extremely fast it also supports

  46. 1:31

    geospatial queries to find all the

  47. 1:33

    documents near a geographic location in

  48. 1:35

    addition to queries you can also create

  49. 1:37

    data aggregation pipelines which can

  50. 1:39

    group documents together and reduce them

  51. 1:41

    to a single result mongodb is free to

  52. 1:44

    use and can be self-hosted but the

  53. 1:46

    quickest way to get started is with the

  54. 1:47

    free tier on Atlas it scales

  55. 1:49

    automatically and provides a UI where

  56. 1:52

    you can interact with your data plus a

  57. 1:54

    ton of other awesome features like

  58. 1:55

    fulltech search that leverages the power

  59. 1:57

    of Apache Lucine in addition they just