Should Your Database Systems Use Hardware-Assisted Memory Safety Extensions in Production?
Ilya Meignan--Masson, Martin Fink, Masanori Misono, Dimitrios Stavrakakis, Pramod Bhatotia
Abstract
Database systems are predominantly developed in unsafe languages (e.g., C/C++) to meet performance requirements through low-level memory management, yet this reliance renders them prone to systemic memory-safety issues that compromise reliability, consistency, security, and durability. Through an extensive bug analysis of prominent database systems, we show that these memory-safety issues persist in production environments despite advancements in database testing tools. While emerging hardware-assisted extensions, such as Arm's Memory Tagging Extension (MTE) and CHERI, offer a promising mitigation path for memory safety, their practical applicability and performance overhead within the specialized constraints of database systems remain largely unexplored. In this paper, we evaluate hardware extensions through the lens of what we define as the database trilemma: the fundamental trade-off between safety, performance, and portability, to determine their viability for production-grade database systems. We provide the first side-by-side comparison of MTE and CHERI across a database workload suite. Our bottom-up study spans microarchitecture, the compiler/runtime/OS stack, core data structures (ART, B+Tree, hash table, skip list, linked list, and queue), and full database systems (Redis, LevelDB, SQLite, MySQL, DuckDB, and LadyBugDB) to characterize their performance, safety guarantees, and ease of adoption. We find that while hardware extensions can offer near-deterministic protection, they introduce non-uniform performance taxes: MTE provides high portability with modest overheads (~10%), while CHERI delivers superior safety guarantees with higher performance penalties (20-60%) and significant porting effort. Our study equips database systems architects with an actionable guide toward building the next generation of reliable, secure databases using hardware-assisted safety mechanisms.
Create a lesson
Related papers
QuarkDB: A Hybrid Database System for Quantum Data Management
Shared title terminology · Wenrui Zhang, Yu Wang, Xiao Zhang
Stop Handcrafting Your Engine! GenDB-V: Towards AI-Generated and Formally Verified Database Systems
Shared title terminology · Jiale Lao, Immanuel Trummer
MetaDB: Putting File-System Structure Back into Distributed Databases
Shared title terminology · Zebin Ren, Biao Cao, Kang Chen et al.
JetStream: Generating Verified Query Accelerators for Existing Database Systems
Shared title terminology · Akhilesh Balasingam, Amadou Ngom, Geoffrey X. Yu et al.
Indexing Designs and Adaptive Data Distribution Optimization for In-Memory Databases on Hybrid DDR--CXL Memory
Shared title terminology · Huijie Cao, Shun Yang, Yinan Zhang et al.
Graph Memory for LLM Agents: At What Cost? A Comparative Evaluation of Query, Ingest, and Update Performance Across Graph Database Engines
Shared title terminology · Donald Nguyen, Gurbinder Gill, Hadi Ahmadi et al.