logo
episode-header-image
Jun 2021
32m 38s

B-tree vs B+ tree in Database Systems

Hussein Nasser
About this episode


In this episode of the backend engineering show I'll discuss the difference between b-tree and b+tree why they were invented, what problems do they solve, and the advantages and disadvantages of both. I'll also discuss the limitation of implementing b-tree over b+tree and how Discord ran into a memory limitation using b-tree Mongo.


Check out my udemy Introduction to Database Engineering course https://husseinnasser.com/courses    Learn the fundamentals of database systems to understand and build performant backend apps


0:00 Data structure and algorithms

1:30 Working with large datasets

6:00 Binary Tree

8:30 B-tree

19:30 B+ tree

22:00 B-tree vs B+ tree benefits

25:00 MongoDB Btree Indexes Trouble

30:00 Summary

working with a billion row table (Members only)

https://youtu.be/wj7KEMEkMUE

indexing video

https://youtu.be/-qNSXK7s7_w

Discord moving from MongoDB to Cassandra

https://www.youtube.com/watch?v=86olupkuLlU

https://blog.discord.com/how-discord-stores-billions-of-messages-7fa6ec7ee4c7

MongoDB Indexes

https://docs.mongodb.com/manual/indexes/

Postgres Indexes

https://www.postgresql.org/docs/13/btree-implementation.html

btree code

https://www.cs.usfca.edu/~galles/visualization/BPlusTree.html

https://www.cs.usfca.edu/~galles/visualization/BTree.html



Support my work on PayPal https://bit.ly/33ENps4 

 Become a Member on YouTube

 https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join 🧑‍🏫 

Courses I Teach https://husseinnasser.com/courses


--- Support this podcast: https://anchor.fm/hnasr/support
Up next
Jun 13
kTLS - Kernel level TLS
Fundamentals of Operating Systems Course https://oscourse.winktls is brilliant.TLS encryption/decryption often happens in userland. While TCP lives in the kernel. With ktls, userland can hand the keys to the kernel and the kernel does crypto. When calling write, the kernel encryp ... Show More
22m 55s
May 9
The beauty of the CPU
If you are bored of contemporary topics of AI and need a breather, I invite you to join me to explore a mundane, fundamental and earthy topic.The CPU.A reading of my substack article https://hnasr.substack.com/p/the-beauty-of-the-cpu 
9m 38s
Apr 18
Sequential Scans in Postgres just got faster
This new PostgreSQL 17 feature is game changer. They know can combine IOs when performing sequential scan. Grab my database coursehttps://courses.husseinnasser.com 
27m 36s
Recommended Episodes
Jun 2023
#420: Database Consistency & Isolation for Python Devs
See the full show notes for this episode on the website at talkpython.fm/420 
56m 2s
Mar 2023
Moving up a level of abstraction with serverless on MongoDB Atlas and AWS
The history of computing has been a story of moving up levels of abstraction: from hard-coding algorithms and directly manipulating memory addresses with assembly languages to using more natural language constructs in high-level general purpose languages to abstracting the hardwa ... Show More
26m 8s
Sep 2021
S17:E9 - What are some database architectures and their use cases (Kyle Bernhardy)
In this episode, we talk about database architectures and some of their use cases, with Kyle Bernhardy, CTO of HarperDB. Kyle talks about what a database is, different types of databases, and when you might want to use one type of database over another. Show Links DevDiscuss (spo ... Show More
48m 31s
Mar 2020
Easier Stream Processing On Kafka With ksqlDB
Summary Building applications on top of unbounded event streams is a complex endeavor, requiring careful integration of multiple disparate systems that were engineered in isolation. The ksqlDB project was created to address this state of affairs by building a unified layer on top ... Show More
43m 36s
May 2023
The ORMazing show
Nick & KBall sit down with the brilliant Stephen Haberman to discuss all things ORMs! 💻🔍 From the advantages and disadvantages of ORMs in general, to delving into the intricacies of his innovative project Joist, which brings a fresh, idiomatic, ActiveRecord-esque approach to Ty ... Show More
1h 12m
Oct 2022
Going From Transactional To Analytical And Self-managed To Cloud On One Database With MariaDB
Summary The database market has seen unprecedented activity in recent years, with new options addressing a variety of needs being introduced on a nearly constant basis. Despite that, there are a handful of databases that continue to be adopted due to their proven reliability and ... Show More
52m 4s
Feb 2023
Shorten the distance between production data and insight
Modern networked applications generate a lot of data, and every business wants to make the most of that data. Most of the time, that means moving production data through some transformation process to get it ready for the analytics process. But what if you could have in-app analy ... Show More
20m 27s
Feb 2016
[MINI] k-d trees
This episode reviews the concept of k-d trees: an efficient data structure for holding multidimensional objects. Kyle gives Linhda a dictionary and asks her to look up words as a way of introducing the concept of binary search. We actually spend most of the episode talking about ... Show More
14m 11s
Jun 2021
A Candid Exploration Of Timeseries Data Analysis With InfluxDB
Summary While the overall concept of timeseries data is uniform, its usage and applications are far from it. One of the most demanding applications of timeseries data is for application and server monitoring due to the problem of high cardinality. In his quest to build a generali ... Show More
1h 6m
Jun 2021
Accelerating ML Training And Delivery With In-Database Machine Learning
Summary When you build a machine learning model, the first step is always to load your data. Typically this means downloading files from object storage, or querying a database. To speed up the process, why not build the model inside the database so that you don’t have to move the ... Show More
1h 5m