I built a thread-safe Buffer Pool Manager for an open source DBMS

[ posted 2024-04-21 @ 6:11 AM ]

Link to the repo

I'm excited to share that I've recently completed a project on creating a thread-safe buffer pool manager for an open-source DBMS called BusTub. The buffer pool manager is a crucial component of any database management system, responsible for managing the memory used to cache database pages.

This project was the first assignment from the CMU 15-445 graduate course "Database Systems" at Carnegie Mellon University. The course is renowned for its rigorous curriculum that challenges students to build critical components of a fully functional DBMS. By completing this project, I not only gained practical experience in implementing fundamental database concepts but also set the foundation for future assignments in the course.

One of the key challenges in implementing a buffer pool manager is ensuring thread safety, especially in a multi-threaded environment where multiple threads may concurrently access and modify the buffer pool. To achieve this, I used synchronization techniques with mutexes to ensure that only one thread can access the buffer pool at a time, preventing data corruption and ensuring consistency.

Another important aspect of the project was implementing eviction policies to decide which pages to evict from the buffer pool when it becomes full. I implemented the LRU-k (Kth Least Recently Used) eviction policy, which is a common and efficient algorithm for buffer pool management.

Overall, this project was a great learning experience for me, helping me deepen my understanding of database internals and multi-threaded programming using C++. I'm looking forward to applying these skills to future assignments in the CMU 15-445 course.