Fireship · @fireship

Cassandra in 100 Seconds

Uploaded July 13, 2022 · Length 2:26

Cassandra in 100 Seconds

Summary

cassandra database explained in 100 seconds: a wide column store for big data with horizontal scaling and no single point of failure.

  • cassandra database
  • nosql database
  • wide column store
  • horizontal scaling
  • database design

Transcript preview

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

  1. 0:00

    [Music]

  2. 0:00

    cassandra a wide column store nosql

  3. 0:02

    database famous for its ability to

  4. 0:04

    distribute petabytes of data with

  5. 0:06

    unmatched reliability and performance it

  6. 0:08

    was created in 2008 by avinash lakshman

  7. 0:11

    who was responsible for scaling

  8. 0:12

    facebook's inbox search feature by 2010

  9. 0:15

    it became a top-level apache project and

  10. 0:17

    today is used at scale by big companies

  11. 0:19

    like apple which manages a staggering

  12. 0:21

    100 petabytes of data across hundreds of

  13. 0:23

    thousands of server instances it's a

  14. 0:25

    general purpose database with use cases

  15. 0:27

    for e-commerce content management audit

  16. 0:29

    logging and everything in between each

  17. 0:31

    instance of cassandra is called a node

  18. 0:33

    and typically stores about two terabytes

  19. 0:35

    of data what makes it special though is

  20. 0:36

    that nodes can be easily distributed to

  21. 0:38

    scale horizontally every node has the

  22. 0:41

    same read write capabilities of another

  23. 0:43

    node but is responsible for its own

  24. 0:44

    partition of data nodes are grouped

  25. 0:46

    together in a cluster or ring and data

  26. 0:48

    is typically replicated on multiple

  27. 0:50

    nodes which means no single point of

  28. 0:52

    failure and 100 uptime the data is

  29. 0:54

    wrapped in a key space giving developers

  30. 0:56

    control over how it replicates in the

  31. 0:58

    cluster each key space contains one or

  32. 1:00

    more tables which represent tabular data

  33. 1:02

    like you might find in a relational

  34. 1:04

    database however it's schema-less and

  35. 1:06

    can handle unstructured data which

  36. 1:08

    developers can manage with the cassandra

  37. 1:09

    query language the easiest way to get

  38. 1:11

    started is by creating a free serverless

  39. 1:13

    database with astra it deploys to the

  40. 1:15

    cloud of your choice then scales

  41. 1:17

    automatically on demand first we'll need

  42. 1:19

    to define a key space which acts as a

  43. 1:21

    container for replication next we'll

  44. 1:23

    need to connect to the database which

  45. 1:25

    can be accomplished in a variety of ways

  46. 1:26

    it has sdks for major languages and a

  47. 1:29

    tool called stargate that makes data

  48. 1:31

    accessible via ras graphql and grpc or

  49. 1:34

    you can execute raw cql code which is a

  50. 1:36

    subset of sql create a table and include

  51. 1:39

    a primary key to uniquely identify every

  52. 1:42

    row then each column will have its own

  53. 1:44

    name and data type now add data to that

  54. 1:46

    table with the insert into statement

  55. 1:48

    then you select to read data from the

  56. 1:50

    table it's also possible to use the

  57. 1:52

    where clause to filter and query the

  58. 1:54

    data but an index will be required on

  59. 1:56

    the column on the surface this may look

  60. 1:58

    a lot like a relational database but it