The Most Complicated Algorithm I've Ever Written: SQLite B-Tree Balancing

Опубликовано: 25 Март 2026
на канале: Tony Saro
56,648
2.8k

In this video we visualize how the SQLite 2.X.X B-Tree balancing algorithm works. Technically it's not exactly the algorithm from SQLite but my own version which I implemented for MKDB. My version is almost a 1:1 Rust copy of the original algorithm implemented in C which you can find linked below.

🌐 LINKS

Algorithm Implementation:
https://github.com/antoniosarosi/mkdb...

Original SQLite Implementation:
https://github.com/antoniosarosi/sqli...

✉️ CONTACT INFO

Business Email: [email protected]
Contact Email: [email protected]
Twitter:   / antoniosarosi  
Instagram:   / antoniosarosi  
LinkedIn:   / antoniosarosi  

🎵 MUSIC

   • 【Chillstep】Wayr - Against Fate  
   • Swell  
   • Could We Say Goodbye  

📖 CHAPTERS

00:00 Introduction
00:41 Databases & B-Trees
03:30 The Balancing Algorithm
09:24 Deleting & Balancing
12:03 Final Thoughts

🏷️ HASHTAGS

#programming
#computerscience
#algorithm