Understanding B-Trees: The Data Structure Behind Modern Databases

preview_player
Показать описание
B-trees are a popular data structure for storing large amounts of data, frequently seen in databases and file systems. But how do they really work? What makes them efficient? In this video, we explore the inner workings of the B-tree, aiming to understand the properties that make them useful and the elegant algorithms that make working with them possible.

***

Рекомендации по теме
Комментарии
Автор

I really like how the little guys turn their heads to look at the thing you're talking about :)

muno
Автор

Beautiful explanation. I love the animations. As someone who's implemented a few persistent B-trees, allow me to point out a few more details:
* This is the classic original B-tree. However, most databases use a B+tree, which is different in that the values are stored only in the leaves; keys in upper nodes just point to lower nodes. When a node splits, you don’t move the middle value up, it stays in one leaf or the other.
* B-trees I’ve looked at, like SQLite, don’t have a fixed number of keys in a node. In real usage, keys and/or values are variable size, like strings, and the nodes are fixed-size disk pages (often 4kb.) The number of keys or values that fit in a node is highly variable. So instead you keep adding to a node until its size in *bytes* overflows a page, and then split. Some nodes might have a hundred keys, some might have only four. It doesn’t matter; the algorithms still work.

mooseyard
Автор

Such a simple but beautiful animation! So many channels do such complex animations but they do not realise simple animations can be so beautiful.

asishreddy
Автор

I have an exam on algorithms and data structures in 3 days and this video manages to break down hours of lectures into 12 minutes... Incredibly helpful

tobsam
Автор

Lol that's actually my first time hearing about a b tree, looks awesome and elegant and simple

MaxPicAxe
Автор

I didn't understand B-trees from university classes but now I do. 3 days before exam. Thank you!

amongusztav
Автор

Just saying thank you from behalf of the community for those amazing visualization teaching vids and for the quality you put in them

TheSilentknight.
Автор

Important timestamps.

**Insertion Scenarios:**
5:08 - Basic Insertion
6:20 - Another Basic Insertion with Root partially full
6:50 - Insertion with full root

**Deletion Scenarios:**
7:48 - Basic Deletion
8:15 - Deletion of Key in Node w/Min Count (take sibling key - it becomes new separator - old separator is moved to original node where deletion occurred)
9:42 - Deletion of Key when Sibling Nodes are also at Minimum Count (merge sibling and separator together into single full node)
10:10 - Same as above, but causing Parent node to fall below Minimum Count as well
10:28 - Deletion of key from middle of tree (new separator needed - either take largest val in left subtree, or smallest val in right subtree - may need to take key from sibling or merge 2 nodes together if it causes child node to fall below min key count)

HudsonGTV
Автор

Man, I remember having balancing B-Trees as assignments in my CS exams and failing to get the right answers. This video does a much better job of explaining it than any class I took in university in a fraction of the time we spent learning it. Thanks for finally getting me to understand👍

LordHonkInc
Автор

This is a great video. Normally, databases do not store data in internal nodes, only leaf nodes and function as intermediate pointers. Leaf nodes on the other hand contain the actual data entries or pointers to those data entries. Additionally, most databases have pointers to neighboring leaf nodes. By the way, these pointers to neighboring leaf nodes help lot with solving concurrent operations on the B-Tree.

esra_erimez
Автор

Fed up with my living room being a mess, I decided to watch this. Oddly think it's going to help

MichaelChin
Автор

This channel has been a massive help for me in understanding the concepts in my algorithms class well enough to actually pass the assignments.

FutureAIDev
Автор

So good, the easiest explanation for such a common data structure I've seen. It's crazy how we teach all these other trees in computer science classes but leave out the most used one.

I especially appreciated the performance advantages against binary trees being explained.

Eckster
Автор

This is a REALLY good series and I wish Spanning Tree would post more content.
They have a fantastic layout, information is conveyed well, and it's thorough but not so technical that people don't understand it.
Please make more content. It's hard to find solid video series like this that explain important programming concepts.
10/10

The_Pariah
Автор

Modern science requires modern teachers like you ❤❤

sarthaksavarn
Автор

Wow! Great explanation!

Basically the same as how we learned it 45 years ago, but with these animations it takes much less time. Back than, the professor was running around with chalk to change the diagrams on the chalkboard ...

peterpesch
Автор

0:00 🌳 Binary search trees organize data for efficient searching based on key values.
1:12 🔄 Increasing nodes to three instead of two in a search tree can sometimes reduce efficiency.
2:26 🚀 B-trees optimize data storage by allowing nodes to hold multiple keys, enhancing search performance.
4:04 ⚖️ B-trees maintain balance with rules on node key counts, ensuring consistent search efficiency.
7:40 🗑 Deleting from a B-tree involves merging nodes or redistributing keys to maintain structure and efficiency.

dameanvil
Автор

I've just started the CS50 AI course as background learning at work, and imagine my surprise to hear this voice again. I really enjoy your teaching style, and I'm so glad to have found more content from you!

offtheball
Автор

Ever since I found out about binary trees, I have loved the elegance and efficiency. I always wondered if there was a way to add more keys. Your video did an excellent job of explaining that not only is it possible, but it is favorable in some cases.

bausHuck
Автор

This is the most simple and efficient intuition I have seen to understanding B-Trees. Really appreciate it

rohitannamaneni
welcome to shbcf.ru