TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sqlite3-Rsync (Draft)

46 pointsby alpn8 months ago

3 comments

OskarS8 months ago
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 months ago
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 months ago
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.