Introduction
Modern database management systems (DBMS) face significant challenges due to dynamic data distributions and fluctuating workloads. While "learned" components have emerged to optimize performance, they often suffer from "drift"—where models become obsolete as underlying patterns change. NeurDB addresses this by moving beyond external AI integration, instead proposing a "deep fusion" where AI is holistically embedded into the database core to enable real-time adaptation.
System Architecture and Deep Fusion
NeurDB's architecture is built on an in-database AI ecosystem. Unlike traditional systems that treat AI as an external service, NeurDB redesigns the query executor to include native AI operators for training, inference, and fine-tuning.
A key innovation is the AI Engine, which utilizes a dedicated Data Streaming Protocol to minimize data movement overhead between the storage engine and the AI runtime. By embedding AI directly, the system can access fine-grained internal metrics—such as buffer usage and lock contention—enabling it to detect and respond to drift as it happens. Furthermore, NeurDB extends SQL with keywords like PREDICT VALUE OF, making AI analytics transparent to developers.
Incremental Adaptation and Model Management
To handle drift efficiently, NeurDB employs a "layered model storage" approach. Rather than retraining models from scratch when data shifts, the system performs incremental fine-tuning on only the final layers of the neural network. This allows for rapid adaptation with minimal computational and storage costs, ensuring the database remains optimized even during sudden changes, such as e-commerce flash sales.
Fast-adaptive Learned Components
NeurDB applies its AI-native design to two critical database functions, utilizing the Filter-and-Refine Principle (FRP) to quickly eliminate unpromising strategies before performing resource-intensive optimization:
- Learned Concurrency Control (NeurDB(CC)): Uses Reinforcement Learning (RL) to decide whether to acquire a lock, block, or abort a transaction based on the current "contention state."
- Learned Query Optimizer: Employs a dual-module encoder/analyzer architecture using tree transformers and cross-attention to map candidate query plans to current system conditions.
Evaluation and Key Results
NeurDB was evaluated using real-world analytics tasks (Avazu for e-commerce, UCI Diabetes for healthcare) and synthetic benchmarks (YCSB, STATS). Key findings include:
- Efficiency: NeurDB achieved up to 48.6% lower end-to-end latency and 3x higher training throughput compared to external AI integrations (e.g., PostgreSQL with an external runtime).
- Drift Resilience: Incremental updates allowed NeurDB to converge faster and maintain lower loss values during data distribution swaps compared to static models.
- Component Performance: The learned concurrency control outperformed state-of-the-art solutions like Polyjuice by up to 2.05x, while the query optimizer reduced average latency by up to 20.32% compared to other learned optimizers like Bao and Lero.
Conclusion and Future Work
NeurDB demonstrates that true database autonomy requires deep AI integration. By treating AI as a first-class citizen within the DBMS, NeurDB achieves superior adaptability and performance. Future research directions include exploring flexible model topologies that can dynamically adjust their own architecture and extending NeurDB into a disaggregated, cloud-native HTAP environment.
Summary updated