How Do Databases Store Tables on Disk? Explained both SSD & HDD

Sdílet
Vložit
  • čas přidán 2. 06. 2024
  • in this video I explain how database systems store their data on Disk both f from SSD (solid-state drives) and HDD (HarD disk drive).
    There are many factors that go into that discussion so I tried to cover the high level here.
    Reseources
    www.extremetech.com/extreme/2...
    www.percona.com/blog/2019/12/...
    🏭 Software Architecture Videos
    • Software Architecture
    💾 Database Engineering Videos
    • Database Engineering
    🛰 Network Engineering Videos
    • Network Engineering
    🏰 Load Balancing and Proxies Videos
    • Proxies
    🐘 Postgres Videos
    • PostgresSQL
    🚢Docker
    • Docker
    🧮 Programming Pattern Videos
    • Programming Patterns
    🛡 Web Security Videos
    • Web Security
    🦠 HTTP Videos
    • HTTP
    🐍 Python Videos
    • Python by Example
    🔆 Javascript Videos
    • Javascript by Example
    👾Discord Server / discord
    Support me on PayPal
    bit.ly/33ENps4
    Become a Patreon
    / hnasr
    Stay Awesome,
    Hussein
  • Věda a technologie

Komentáře • 67

  • @yashbudukh340
    @yashbudukh340 Před 4 lety +25

    Amazing content man.Please make a video on sql vs no-sql and when to choose which.

  • @timothyruszala4973
    @timothyruszala4973 Před rokem

    What an amazing speaker-You're most engaging speaker on software engineering I've ever seen!

  • @abhirishi7
    @abhirishi7 Před 4 lety +2

    I mostly watch your videos to hear your accent..its super cool. and besides you provide some really good information too.

  • @shubhamgupta-to7so
    @shubhamgupta-to7so Před 4 lety +4

    Thank you so much Hussein
    Very Informative. Never knew this before.
    Btw the sound effect at 02:52 was exactly the same when I do I/O stuffs in my system. hahahaha

  • @8Trails50
    @8Trails50 Před 3 lety +5

    This channel is a goldmine

  • @nekoill
    @nekoill Před 2 lety

    My man, I gotta say I love the way you present information. I'd love to be your neighbor and spend time just rambling on about curious IT stuff.

  • @hemantsinghjadon849
    @hemantsinghjadon849 Před rokem +1

    Really informative.
    Would love to see some examples of this actually affecting the engineering decisions companies made.

  • @harshgandhi4328
    @harshgandhi4328 Před 4 lety +5

    Awesome content Hussein. Thanks a lot. Can you make a video as to how memory management works in NodeJs/Chrome V8?

  • @davidraj2862
    @davidraj2862 Před 4 lety +1

    Amazing absolutely love your content 👌🏻

  • @jondoe79
    @jondoe79 Před 4 lety +1

    Superb content as always 👌

  • @dudibs1
    @dudibs1 Před 3 měsíci

    great intuitive explanation. thx

  • @sundaramjha1776
    @sundaramjha1776 Před 4 lety +1

    Thank You for making this video. I have requested for it. Keep sharing ur knowledge with us.

    • @hnasr
      @hnasr  Před 4 lety +2

      Sundaram Jha yes it was great suggestion! Video is getting popular.

  • @AnantaAkash.Podder
    @AnantaAkash.Podder Před měsícem

    Wow... Amazing content sir...😃

  • @pokiripandoo
    @pokiripandoo Před 4 lety +1

    Respect for the PS on the back ❤️

  • @MuztabaHasanat
    @MuztabaHasanat Před 4 lety +1

    It's a damn good video!

  • @AbleToLiveHere
    @AbleToLiveHere Před 3 lety

    Great video. As usual. Thank you.

  • @ashutoshmishra2328
    @ashutoshmishra2328 Před 3 lety +4

    Hey Hussein, thanks for this video 😃
    Can you make a video on clustered and Nonclustered indexes also, it has a major role in storing records of tables in memory and it is bit complex. I tried to understand it but didn't understand much. It'll be great if you can make a video about it.
    Thanks 😃

    • @hnasr
      @hnasr  Před 3 lety +3

      Great topic

  • @techwithameer
    @techwithameer Před 3 lety

    Awesome infos bro

  • @timbui5556
    @timbui5556 Před 2 lety

    Hi Hussein, how can I put my Postgres data on a portable SSD so that I can use the Postgres on my desktop and laptop without restoring? Thank you so much for your teaching!

  • @9831599481
    @9831599481 Před 4 lety +1

    Ur videos are dope

  • @section9999
    @section9999 Před 3 lety +1

    Very useful stuff. 👍 But I have a question! Would you mind sharing the link @15.42? I was thinking of building a project for DB algorithm visualization so I want to make sure its both distinguishable from that and useful in a practical sense for the average DB student and professional.

    • @hnasr
      @hnasr  Před 3 lety +1

      Sure thing! www.cs.usfca.edu/~galles/visualization/BTree.html

    • @section9999
      @section9999 Před 3 lety

      @@hnasr Cool man i greatly appreciate that!

  • @amitmahadik4653
    @amitmahadik4653 Před 4 měsíci

    Really great explanation, just curious to know how cloud storage stores data

  • @euriskoo
    @euriskoo Před 2 lety

    Hello Hussein, why do we need to the virtual memory when we retrieve a data from a disk?

  • @suryabhusal1527
    @suryabhusal1527 Před 4 lety

    Hello sir, i really enjoy your videos. Those content are rerely found while entering into microservice jungle :P. But i've one issue. I've watched your all backend engineering playlist. But i'm still confused on how to implement Saga Orchesteration using RabbitMQ. Please Please i need this!! Thank you for such wonderful videos. Love Love !!!!!

  • @jackedelic9188
    @jackedelic9188 Před 3 lety

    so does it mean given a choice, i better use LSM-indexing db engine (cus btree rebalancing killing ssd)? How easy/hard isit to switch db engine?

  • @saurabhsharma7123
    @saurabhsharma7123 Před 3 lety

    Keep up the novel work. Hats-off!

  • @janetachieng8990
    @janetachieng8990 Před 3 lety

    very nice,got it

  • @rahulspoudel
    @rahulspoudel Před 2 lety

    Keep up the great work man. 2:51 LMAO

  • @lucavogels
    @lucavogels Před 4 lety

    How do Key-Value stores actually store the data on this? Because size per entry isn’t that fixed as in relational DBs

  • @fatememalekan3522
    @fatememalekan3522 Před 2 lety

    that was perfect

  • @singaravelann3671
    @singaravelann3671 Před 4 lety +6

    Thanks for this video, Can you explain why RAM is faster than disk seek and can you explain how the data are organized in ram.

  • @lieblius
    @lieblius Před 4 měsíci

    Great video explaining things at the OS level, but aren't databases interfacing with file system api's to abstract this all away? I don't really understand the reason to bring databases into the conversation here.
    Edit: I see this is part of a database engineering playlist. I think it would have been clear to me if the OS level was mentioned a bit instead of jumping straight from database to what happens on disk. That made me think for a second that database implementations were mainly going straight to I/O instead of using the native OS tooling. I was looking for explanations on how databases handle concurrency when writing to files as well as explanations on the format in which the files are stored.

  • @apusingh1967
    @apusingh1967 Před rokem

    yo' grt Nasser lv u
    there is some confusion
    HDD sector size is mostly 512 BYTE, and OS reads in sectors nothing less.. so OS blocks are same as sector looks like.
    SSD doesn't have sectors. It has pages and blocks. The block size is mostly 512 KILO BYTE! Pages are usually 4 KILO BYTE. So one block has 128 pages in SSD. OS running in native mode will read/write in pages looks like. But garbage collection etc will work with blocks, since updates are rather intensive as you mentioned.

  • @RahulSharma_rsconcept
    @RahulSharma_rsconcept Před 4 lety +2

    Amazing content! :) Just to add to the last mention on Rocksdb, from what I have read. RocksDB is a fork of LevelDB, which itself is an open source storage engine implementation off from Google Bigtable’s tablet storage engine (proprietary ). But yeah, each of these system’s underlying data structure is an LSM Tree. They give you higher write throughput vs BTrees which performs better for reads.

    • @hnasr
      @hnasr  Před 4 lety +1

      Rahul Sharma thanks Rahul For the additional info! Correct! RocksDB is a fork of Level I mentioned that on my database engine video Database Engines Crash Course (MyISAM, Aria, InnoDB, XtraDB, LevelDB & RocksDB)
      czcams.com/video/K9Qd3UMHUQ4/video.html

  • @arjungambhir94
    @arjungambhir94 Před 3 lety

    Lovely, great content ❤️, can I know some of the names of books behind you? Looks so interesting

    • @hnasr
      @hnasr  Před 3 lety

      Thanks 🙏 Sure I made a video czcams.com/video/59Z3DlSu8tU/video.html

  • @5_inchc594
    @5_inchc594 Před rokem

    "It reads the hold god damn block ." hhhh your video is funny, thanks for the explaination .

  • @youtubewatcher5500
    @youtubewatcher5500 Před 3 lety

    How the database programm can find the beginning of the block on the disc?

  • @shobhitmittal77
    @shobhitmittal77 Před rokem

    Awesome Content Sir..
    Reminded of The Joker in Dark Knight!!

  • @snake1625b
    @snake1625b Před 2 lety

    Is the extra speed of the SSD worth the extra cost?

  • @AAZinvicto
    @AAZinvicto Před 4 lety +1

    People, If you want to do a deep dive into Databases, search for "CMU Database Group" on youtube.
    Great video Hussein! Keep it up!

    • @hnasr
      @hnasr  Před 4 lety

      Thanks !! Yes Sam shared the resources those are excellent. 😊

    • @hnasr
      @hnasr  Před 4 lety

      Thanks !! Yes Sam shared the resources those are excellent. 😊

    • @AAZinvicto
      @AAZinvicto Před 4 lety +1

      @@hnasr
      Oh, didn't notice. :D

  • @abhishekhamal3126
    @abhishekhamal3126 Před 10 měsíci

    How can I learn more on what you are talking about?

  • @420_gunna
    @420_gunna Před 4 lety +2

    Yeeesssss Hussein. I don't remember if i recommended this, but you have _GOT_ to take Andy Pavlo's database systems and advanced database systems courses on CZcams from CMU. Best class I've taken, covers a lot of things (esp the advanced course) that I think you, me, and a lot of people here find interesting. Enjoy!

    • @420_gunna
      @420_gunna Před 4 lety

      First lectures of each here:
      Intro: czcams.com/video/oeYBdghaIjc/video.html
      Advanced: czcams.com/video/SdW5RKUboKc/video.html

    • @420_gunna
      @420_gunna Před 4 lety

      Also, the MIT 6.824 Distributed Systems course on CZcams. Taught by Robert Morris, the inventor of the first computer worm!
      (Also the UWaterloo and UCSC Distributed systems courses aren't bad ;) )

    • @420_gunna
      @420_gunna Před 4 lety

      Oh by the way designing data intensive systems by Kleppman and Database internals by Petrov are must reads! :)

    • @hnasr
      @hnasr  Před 4 lety

      Sam Silver Awesome ! Thanks Sam for sharing

  • @montassar_akrmi
    @montassar_akrmi Před rokem

    Are you really appreciate the tech behind it? What does "ugly disk" even mean?

  • @bhys570
    @bhys570 Před 3 měsíci

    Can someone explain to me why he said the data is stored on four bytes

  • @prashanthkumar0
    @prashanthkumar0 Před 9 měsíci

    This video is really scary , much scary than watching insidious ,
    Reason: Just upgraded my hdd to ssd and going to learn dbms by making one ( using B-Trees ).

  • @jameskennedy674
    @jameskennedy674 Před 2 lety

    Nice video. However all the sound effects do not add anything to the content, or provide comedic effect.

  • @thinkingcitizen
    @thinkingcitizen Před 3 měsíci

    had to hit pause within the first few minutes to imagine a beautiful table.... 10 mins later, still nothing...

  • @aman2426
    @aman2426 Před 2 lety

    How many accents...italian, french, german, indian, arabic..

  • @miresoman1769
    @miresoman1769 Před rokem

    Sorry bro but 'sasta' Zayn Malik

  • @vaibhavkumargautam
    @vaibhavkumargautam Před 10 měsíci

    Bkl sahi se padhna sheekh.

  • @dancingdev1088
    @dancingdev1088 Před rokem

    Why does he act like Neil degrasse tyson?