Breaking Database Lock-in: Agentic Regeneration of High Performance Storage Readers for Database Bypass

LLM Other LLM AI Systems and Hardware Text-to-Code Other AI Sys & HW
运行于外部数据库系统所存储数据之上的分析型工作负载,面临一个根本性瓶颈:数据访问完全受数据库驱动程序(如 JDBC 或 ODBC)管控,迫使所有读取操作均需经由查询执行及其他驱动层完成——而这些层并非为大规模列式分析而设计。本文提出 Jailbreak 方法,该方法完全绕过数据库引擎,直接读取底层存储文件,并将数据物化为内存中的列式缓冲区。Jailbreak 的核心洞见在于:尽管数据库的文件格式较为复杂,但其结构在源代码与官方文档中均有完整定义;而大语言模型(LLM)能够消化这些资料,并据此自动生成面向特定数据库算子的表读取组件,无需人工编写解析逻辑。Jailbreak 借助大语言模型辅助的代码生成技术,实现对数据库存储格式的解码,从而将传统上不透明的存储格式转化为可直接查询的数据载体。我们在 PostgreSQL 和 MySQL 的存储文件上对 Jailbreak 进行了评估,聚焦于读写分离架构中的只读副本及离线处理流水线等典型分析快照场景。所生成的读取器可输出 Apache Arrow 格式的内存缓冲区,该格式可被当前主流查询引擎直接消费,包括 DuckDB、Apache Spark,以及基于 GPU 加速的框架(如 cuDF 和 Spark RAPIDS)。我们采用 TPC-H 基准测试,在全部查询结果上与基于 JDBC/ODBC 的基线方案进行对比,验证了 Jailbreak 输出结果的正确性;同时,在端到端分析吞吐量方面展现出显著性能提升,最高可达 27 倍加速。实验结果表明:借助大语言模型辅助生成存储读取器,是一种切实可行且具备广泛适用性的方法,可用于打破不同数据库系统间的数据锁定局面;只要某数据库系统的文件格式可通过其公开文档或源代码被大语言模型获取,该方法即可推广至 PostgreSQL 和 MySQL 之外的其他系统。
Analytical workloads operating on data stored in external database systems face a fundamental bottleneck: data access is guarded entirely by the database driver, like JDBC or ODBC, forcing all reads through query execution and other driver layers that are not designed for bulk columnar analytics. We present Jailbreak, an approach that bypasses the database engine entirely by reading storage files directly and materializing data as in-memory columnar buffers. Jailbreak's key insight is that database file formats, while complex, are fully specified by their source code and documentation, artifacts that Large Language Models (LLMs) can ingest to regenerate operator-specific table reading components without human-engineered parsing logic. Jailbreak leverages LLM-assisted code synthesis for database storage decoding, turning a traditionally opaque format into a directly queryable artifact. We evaluate Jailbreak on PostgreSQL and MySQL storage files, targeting analytical snapshot scenarios common in read replicas and offline processing pipelines. The generated reader produces Apache Arrow buffers consumable directly by most of the widely known query engines, including DuckDB, Apache Spark, and GPU-accelerated frameworks such as cuDF and Spark RAPIDS. We validate correctness against JDBC/ODBC-based baselines using the TPC-H benchmark across all query results, and demonstrate significant performance improvements in end-to-end analytical throughput, achieving up to 27x speedups. Our results showcase that LLM-assisted storage reader synthesis is a viable and generalizable methodology for breaking data lock-in across database systems, with applications beyond PostgreSQL and MySQL for any system whose file format is available to the LLM from documentation or source code.
许愿