TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Sqlite3-Rsync (Draft)

46 点作者 alpn8 个月前

3 条评论

OskarS8 个月前
Very cool! This seems like an excellent backup utility as part of core SQLite. Great that you can still run write transactions on the origin while it’s in progress, i wonder what the guarantees are there for which in-progress transactions are synced to the replica.<p>EDIT: ah, missed this part<p>&gt; REPLICA becomes a copy of a snapshot of ORIGIN as it existed when the sqlite3-rsync command started. If other processes change the content of ORIGIN while this command is running, those changes will be applied to ORIGIN, but they are not transferred to REPLICA Thus, REPLICA ends up as a fully-consistent snapshot of ORIGINAL at an instant in time.
justinclift8 个月前
Interestingly, it seems like this utility can create read-only replicas on a different host:<p><pre><code> While sqlite3-rsync is running, REPLICA is read-only. Queries can be run against REPLICA while this utility is running, just not write transactions. </code></pre> That seems like it&#x27;ll be useful in some novel high load situations.
phaedrus8 个月前
I wonder if this could be used in a build step to bring a Sqlite DB in a project&#x27;s &quot;bin&#x2F;&quot; folder up to date with a source-controlled copy without just overwriting the whole file. Size of the DB file is one issue, but also I&#x27;m thinking there could be cases (like having a connection open in Sqlite Studio, or a running instance of the project executable) where a simple copy would fail the build step. (This sqlite3-rsync specifically supports working while other connections are open.)<p>If so, it solves a real problem I&#x27;ve been having for eight years.