Introduction
Modern database management systems (DBMS) are increasingly incorporating machine learning to optimize internal processes and provide predictive analytics. However, most current implementations treat AI as an external "bolt-on" layer. This approach suffers from two primary drawbacks: the Adaptability Gap, where models trained on static snapshots fail to account for real-time data drift, and the Integration Tax, where moving data between the DBMS and external AI frameworks introduces significant latency and memory overhead.
NeurDB addresses these challenges by moving AI from the periphery to the core architectural level. By achieving "deep fusion" between AI and the DBMS, NeurDB creates a truly autonomous system capable of self-optimization and real-time adaptation.
Architectural Deep Fusion
The core innovation of NeurDB is its integrated ecosystem where AI operations are treated as first-class citizens. Unlike traditional systems that call external APIs, NeurDB embeds AI tasks directly into the query execution pipeline.
Key architectural shifts include:
- In-Database AI Operators: Training, inference, and fine-tuning are implemented as standard physical operators within the query executor, alongside traditional operators like Scan and Join.
- Dedicated AI Engine: A distributed, event-driven module manages AI tasks. It utilizes a custom Data Streaming Protocol to pipe data directly from storage to AI runtimes, bypassing serialization bottlenecks.
- Incremental Model Management: To handle data drift efficiently, NeurDB employs a layered storage approach. Instead of full retraining, the system fine-tunes specific model layers while freezing others, allowing for rapid adaptation to changing workloads.
- Enhanced SQL Syntax: Standard SQL is extended with a
PREDICTkeyword, making AI tasks transparent to developers.
Autonomous Internal Components
NeurDB applies a "Filter-and-Refine Principle" (FRP) to its internal optimization components. This design philosophy allows the system to quickly narrow down potential strategies before performing fine-grained optimization, leveraging internal system metrics (like buffer usage and contention states) that are invisible to external tools.
Two primary examples of this are:
- Learned Concurrency Control: Using Reinforcement Learning, NeurDB monitors contention states and conflict info to decide on locking actions (e.g., acquire lock vs. abort) in real-time.
- Learned Query Optimizer: An AI-powered optimizer uses encoders and cross-attention layers to analyze buffer info, data statistics, and candidate plans to select the optimal execution path.
Performance and Evaluation
The researchers evaluated NeurDB against state-of-the-art (SOTA) baselines using diverse datasets including Avazu (e-commerce), UCI Diabetes (healthcare), and standard benchmarks like TPC-C and YCSB.
Key results include:
- Efficiency: NeurDB achieved up to 48.6% lower end-to-end latency and 2.92x higher training throughput for AI analytics compared to traditional overlay approaches.
- Adaptability: The incremental update technique allowed models to maintain lower loss values and converge faster during sudden data drifts.
- Optimization Gains: The learned query optimizer reduced average latency by 20.32% over existing learned optimizers by leveraging real-time system conditions.
- Concurrency Throughput: NeurDB's learned concurrency control outperformed the Polyjuice framework by up to 2.05x under shifting transactional workloads.
Conclusion and Future Work
NeurDB demonstrates that embedding AI into the database architecture significantly improves performance and adaptability. By treating models as data and AI tasks as standard operators, it eliminates the overhead of external integration. While the current implementation is integrated into PostgreSQL v16.3, future development will focus on evolving NeurDB into a cloud-native, disaggregated architecture and expanding support for Generative AI and more flexible model topologies.
Summary updated