Abstract
AI-driven analytics are increasingly crucial to data-centric decision-making. The practice of exporting data to machine learning runtimes incurs high overhead, limits robustness to data drift, and expands the attack surface, especially in multi-tenant, heterogeneous data systems. Integrating AI directly into database engines, while offering clear benefits, introduces challenges in managing joint query processing and model execution, optimizing end-to-end performance, coordinating execution under resource contention, and enforcing strong security and access-control guarantees. This paper discusses the challenges of joint DB-AI, or AIxDB, data management and query processing within AI-powered data systems. It presents various challenges that need to be addressed carefully, such as query optimization, execution scheduling, and distributed execution over heterogeneous hardware. Database components such as transaction management and access control need to be re-examined to support AI lifecycle management, mitigate data drift, and protect sensitive data from unauthorized AI operations. We present a design and preliminary results to demonstrate what may be key to the performance for serving AIxDB queries.
Introduction
Modern AI-driven analytics typically follow an "export-execute-import" workflow: data is extracted from a database, moved to an external machine learning runtime (like PyTorch or TensorFlow) for processing, and the results are subsequently re-imported. This paradigm is fundamentally inefficient for contemporary workloads, creating massive data-transfer overhead and leaving systems vulnerable to "data drift" as models become decoupled from live data. Furthermore, the lack of communication between the database and the AI runtime prevents shared resource optimization, leading to significant performance degradation in multi-tenant environments.
Methodology: Database-Native Orchestration
To address these inefficiencies, this research proposes a shift toward database-native orchestration, where AI operators are integrated directly into the database engine as first-class citizens. This approach is built on three core principles:
- Holistic AIxDB Co-Optimization: The query optimizer jointly reasons over both SQL operators (e.g., Joins) and AI operators (e.g., Inference), enabling "cross-boundary rewrites" such as pushing predicates through AI pipelines.
- Unified AIxDB Cache Management: AI artifacts—including embeddings, model weights, and LLM KV-caches—are treated as first-class cacheable objects alongside traditional data pages.
- Fine-Grained Access Control and Isolation: Security is enforced at the operator level, ensuring AI models only access authorized data and preventing resource starvation in multi-tenant GPU environments.
NeurEngine: A Self-Driving Execution Engine
The authors implemented these principles in NeurEngine, a prototype built on the open-source NeurDB (PostgreSQL-based). NeurEngine features a "self-driving" execution engine designed to handle concurrent AIxDB queries through dynamic batching and cross-graph common subexpression elimination (CSE). By identifying identical subplans across different queries—such as shared embedding or preprocessing steps—NeurEngine executes redundant work only once and routes results to multiple users.
Key Results and Evaluation
NeurEngine was evaluated using real-world recommendation (Frappe dataset) and text embedding (Quora dataset) workloads:
- Scalability: In recommendation tasks, NeurEngine demonstrated near-linear scalability as the number of AI engines increased from 1 to 16, whereas traditional baselines were severely limited by data-transfer bottlenecks.
- Throughput: For text embeddings, NeurEngine achieved significantly higher throughput by utilizing "length-aware bucketing," which groups requests of similar sequence lengths to minimize GPU padding overhead.
- Memory Efficiency: The shared-model approach utilized drastically less GPU memory compared to per-task baselines that require dedicated model replicas for every tenant.
Discussion and Future Work
While database-native orchestration offers clear advantages, several challenges remain. Generative models (LLMs) introduce highly variable, token-dependent costs that are difficult to model during query optimization. Additionally, simplifying deep neural networks for predicate pushdown without sacrificing accuracy remains an open research problem. Future work will also focus on automating the detection of subtle data leakages that can occur through AI model operations. Ultimately, this research provides a roadmap for the next generation of AI-native databases that move beyond simple UDFs toward a truly integrated architecture.
Summary updated