<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Database on Text Matrix</title><link>https://txtmix.com/tags/database/</link><description>Recent content in Database on Text Matrix</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Tue, 21 Jul 2026 20:06:14 +0800</lastBuildDate><atom:link href="https://txtmix.com/tags/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Turso Database 深度拆解：把 SQLite 用 Rust 重写一次，到底解决了什么</title><link>https://txtmix.com/posts/tech/tursodatabase-turso-rust-sqlite-rewrite-guide/</link><pubDate>Sat, 20 Jun 2026 20:58:00 +0800</pubDate><guid>https://txtmix.com/posts/tech/tursodatabase-turso-rust-sqlite-rewrite-guide/</guid><description>&lt;h2 id="一学习目标">一、学习目标&lt;/h2>
&lt;p>读完本文，你应该能够：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>解释 Turso Database 的重写动机&lt;/strong>：说清楚为什么 tursodatabase 团队从 libSQL 路线转向 Rust 原生重写，以及 fork 模式和 rewrite 模式的核心差异。&lt;/li>
&lt;li>&lt;strong>描述 Turso Database 的架构分层&lt;/strong>：从 SQL 文本到 page cache 的四层执行路径（Parser/Planner → VDBE-like 字节码执行器 → MVCC 存储层 → io_uring 适配）。&lt;/li>
&lt;li>&lt;strong>理解 &lt;code>BEGIN CONCURRENT&lt;/code> MVCC 的工程取舍&lt;/strong>：知道它是 opt-in 而非默认模式，以及多版本指针的实现边界。&lt;/li>
&lt;li>&lt;strong>使用 Turso 的 MCP Server 让 AI agent 直连数据库&lt;/strong>：能配置 &lt;code>tursodb --mcp&lt;/code>，并在 Claude Code 等工具中调用 9 个 MCP 工具。&lt;/li>
&lt;li>&lt;strong>判断 Turso Database 是否适合你的生产场景&lt;/strong>：能根据可靠性要求、向量搜索需求、Rust 工具链维护能力做出选型决策。&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="二目录">二、目录&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="#%e6%a0%b8%e5%bf%83%e5%88%a4%e6%96%ad" rel="">核心判断&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e5%85%b3%e9%94%ae%e4%ba%8b%e5%ae%9e%e8%a1%a8" rel="">关键事实表&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e9%87%8d%e5%86%99%e5%8a%a8%e6%9c%bafork-%e8%bf%98%e6%98%af-rewrite" rel="">重写动机：fork 还是 rewrite&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e6%9e%b6%e6%9e%84%e5%88%87%e7%89%87%e4%bb%8e-sql-%e6%96%87%e6%9c%ac%e5%88%b0-page-cache" rel="">架构切片：从 SQL 文本到 page cache&lt;/a>&lt;/li>
&lt;li>&lt;a href="#mcp-server%e8%ae%a9-ai-%e7%9b%b4%e6%8e%a5%e5%af%b9%e6%95%b0%e6%8d%ae%e5%ba%93%e8%af%bb%e5%86%99" rel="">MCP Server：让 AI 直接对数据库读写&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e5%a4%9a%e8%af%ad%e8%a8%80%e7%bb%91%e5%ae%9aproduction-%e7%9a%84-6-%e6%9d%a1%e8%b7%af%e5%be%84" rel="">多语言绑定：production 的 6 条路径&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e5%ae%9e%e9%aa%8c%e6%80%a7%e7%89%b9%e6%80%a74-%e6%9d%a1%e8%bf%98%e5%9c%a8%e5%ad%b5%e5%8c%96%e7%9a%84%e8%83%bd%e5%8a%9b" rel="">实验性特性：4 条还在孵化的能力&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e8%b7%af%e7%ba%bf%e5%9b%be%e5%90%91%e9%87%8f%e7%b4%a2%e5%bc%95%e8%bf%98%e6%b2%a1%e8%90%bd%e5%9c%b0" rel="">路线图：向量索引还没落地&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e6%b5%8b%e8%af%95%e4%b8%8e%e5%8f%af%e9%9d%a0%e6%80%a7antithesis--dst-%e5%8f%8c%e5%b1%82%e4%bf%9d%e6%8a%a4" rel="">测试与可靠性：Antithesis + DST 双层保护&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e5%ad%a6%e6%9c%af%e6%88%90%e6%9e%9c%e6%8a%8a%e6%95%b0%e6%8d%ae%e5%ba%93%e5%92%8c-serverless-%e4%b8%80%e8%b5%b7%e8%ae%be%e8%ae%a1" rel="">学术成果：把数据库和 serverless 一起设计&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e7%94%9f%e4%ba%a7%e8%be%b9%e7%95%8c%e4%bb%80%e4%b9%88%e6%97%b6%e5%80%99%e7%94%a8%e4%bb%80%e4%b9%88%e6%97%b6%e5%80%99%e4%b8%8d%e7%94%a8" rel="">生产边界：什么时候用、什么时候不用&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e5%85%a5%e9%97%a8%e8%b7%af%e5%be%84" rel="">入门路径&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e8%87%aa%e6%b5%8b%e9%a2%98" rel="">自测题&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e7%bb%83%e4%b9%a0" rel="">练习&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e8%bf%9b%e9%98%b6%e8%b7%af%e5%be%84" rel="">进阶路径&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e8%b5%84%e6%96%99%e5%8f%a3%e5%be%84%e8%af%b4%e6%98%8e" rel="">资料口径说明&lt;/a>&lt;/li>
&lt;li>&lt;a href="#%e4%b8%80%e5%8f%a5%e8%af%9d%e6%80%bb%e7%bb%93" rel="">一句话总结&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="核心判断">核心判断&lt;/h2>
&lt;p>Turso Database（&lt;code>tursodatabase/turso&lt;/code>）&lt;strong>不是&lt;/strong>「又一个 SQLite 兼容层」，而是 tursodatabase 团队对 SQLite 的 Rust 原生重写：保留 SQLite 的 SQL 方言、文件格式和 C API（&lt;code>COMPAT.md&lt;/code> 详细列出兼容矩阵），把执行器、存储、I/O 全替换为 Rust 实现，再叠加 &lt;code>BEGIN CONCURRENT&lt;/code> MVCC、io_uring 异步 I/O、向量搜索和内嵌 MCP server 四件 SQLite 原版没有的能力。它和 libSQL 是同一个团队走过的两条路线——&lt;code>libSQL&lt;/code> 是 fork（生产可用），Turso 是 rewrite（Beta 但方向被官方 all-in）。对自托管 SQLite 替代方案的选型来说，Turso 现在的状态是「能跑、能加速、但有 Beta 风险」。&lt;/p></description></item></channel></rss>