Repository navigation
Closed
Labels
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
Milestone
Description
This is a notice of intent to experiment. :) I tried to use a SQLite database backend several years ago and it turned out not great. There were several issues at the time; performance, lack of required concurrency in some cases, and difficulty in cross compilation. This time I intend to take a slightly different approach, with slightly different goals, and also things have changed in the wider ecosystem.
- Instead of using it as a dumb key-value store I will use wider tables with at least some fields of the underlying data exposed as columns. The intention is to use native SQLite indexes and processes for a lot of the metadata housekeeping we do manually today.
- If having long running write transactions is still a problem I'll work to split them up -- for example, having a puller iteration be for only a subset of files rather than all that are needed at the time. For ordering items (by size, modification time, etc) we can use SQL constructions with a limit clause.
- There are multiple implementations of SQLite available, the most common being the regular C implementation with a wrapper, which we can use for most builds. For the more exotic builds there is a Go translation of the C source code, which is equally cross compilable to what we have today. We can use either or both as required.
- I'm willing to accept a certain level of performance degradation if it results in improved stability and maintainability.
Reacted by Ross Smith II and tucari
Metadata
Metadata
Assignees
Labels
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
Activity
bt90 commentedon Feb 10, 2025
Not sure if it makes sense for Syncthings database design, but it happens far too often that people use a single sqlite database for everything. Having multiple database files for unrelated data tends to avoid performance bottlenecks.
chore: switch database engine to sqlite (fixes #9954) (#9965)
Michael679089 commentedon Apr 2, 2025
Will the app's processes work faster now?
bt90 commentedon Apr 2, 2025
This is not about speed. The main goal is durability.
koro666 commentedon Apr 9, 2025
This is a good (and overdue) change, thank you. My main issue with
.ldbfiles was that they seemed to be periodically fully rewritten, causing huge (multiple GBs) "incremental" backups every week.Plus, having them in a readable format will allow to go "poke" stuff in there when something gets stuck, such as one side absolutely claiming that a file which was deleted ages ago suddenly is back and unsynced, etc.
Hopefully, the SQLite files will be in a separate directory which I can
chattr +C(to avoid fragmentation).chore(deps): update syncthing/syncthing docker tag to v2 (#2048)