Fireship · @fireship

SQLite and its weird new fork “libSQL”

Uploaded November 13, 2024 · Length 4:30

SQLite and its weird new fork “libSQL”

Summary

SQLite's fork 'libSQL' allows one database per user, improving performance and security with features like replication, encryption, and web assembly triggers.

  • sqlite fork
  • libsql database
  • one database per user
  • replication system
  • encryption at rest
  • web assembly triggers

Transcript preview

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

  1. 0:00

    25 years ago in a Muffy corporate

  2. 0:02

    partition somewhere Richard hip of

  3. 0:04

    General Dynamics was banging out code

  4. 0:06

    for a damage control system on guided

  5. 0:08

    missile destroyers for the US Navy his

  6. 0:10

    work led to one of the most brilliant

  7. 0:11

    important and just Flatout weird

  8. 0:13

    projects ever a SQL light an acid

  9. 0:16

    compliant SQL database that's contained

  10. 0:18

    in one file weighs only 600 kilobytes

  11. 0:20

    and requires no server process what's

  12. 0:23

    crazy though is that it's become the

  13. 0:24

    most deployed database in history with

  14. 0:26

    over 1 trillion in active use almost

  15. 0:28

    every smartphone and computer contains

  16. 0:30

    multiple sqlite databases what's even

  17. 0:32

    more crazy though is that this project

  18. 0:34

    is in the public domain and its source

  19. 0:36

    code is only maintained by three people

  20. 0:38

    no outside contributions allowed and

  21. 0:40

    they don't even have a code of conduct

  22. 0:42

    but that's a good thing if you want to

  23. 0:43

    prevent nerd drama and unauthorized

  24. 0:45

    backdoor penetration but that doesn't

  25. 0:47

    mean you can't Fork it and make it code

  26. 0:49

    do what you want to do and that's

  27. 0:51

    exactly what the creators of lib SQL

  28. 0:52

    have done to support the unhinged use

  29. 0:54

    case of one database for every user in

  30. 0:56

    your app it is November 13th 2024 and

  31. 0:59

    you're watching the code report there's

  32. 1:01

    a reason they call SQL light the most

  33. 1:03

    deployed database in the world it can be

  34. 1:04

    easily embedded it's robust and in

  35. 1:07

    theory can scale up to 140 tabt however

  36. 1:10

    most large scale applications go with

  37. 1:11

    postgress or a nosql database to scale

  38. 1:14

    up to a massive level there's no native

  39. 1:16

    way to Shard and replicate SQL light to

  40. 1:18

    distribute a massive data set around the

  41. 1:20

    world well in October 2022 a couple of

  42. 1:22

    developers launched a fork of SQL light

  43. 1:24

    with no code changes just a Manifesto

  44. 1:27

    and a dream of SQL light with Community

  45. 1:29

    Control that fork is called lib SQL it

  46. 1:31

    maintains SQL like compatibility but

  47. 1:34

    also makes some major changes but the

  48. 1:35

    thing that really inspired me to make

  49. 1:37

    this video is its ability to build apps

  50. 1:39

    where you have one database per user

  51. 1:41

    let's figure out how that's even

  52. 1:42

    possible like I mentioned SQL light

  53. 1:44

    exists as a file and not something you

  54. 1:46

    connect to externally with a server like

  55. 1:48

    poster SQL but alongside this file mode

  56. 1:51

    lib SQL also has a server mode where you

  57. 1:53

    can talk to your database via HTTP and

  58. 1:55

    that allows you to access equl light

  59. 1:57

    from serverless environments like

  60. 1:58

    cloudflare workers or AWS Lambda that's