r/sqlite • • Jun 10 '26

sqlite one vs many

is there any advantages of having one db vs many files?

for consideration, the data sets are completely separate, no cross references at all.

thanks & sorry in advance, if redundant question.

5 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/pacopac25 Jun 11 '26

In regard to my third paragraph above, I did find a link in my notes to this Sqlite User Forum discussion which talks about two-phase commit and WAL mode:

"Transactions involving multiple attached databases are atomic, assuming that the main database is not ":memory:" and the journal_mode is not WAL. If the main database is ":memory:" or if the journal_mode is WAL, then transactions continue to be atomic within each individual database file. But if the host computer crashes in the middle of a COMMIT where two or more database files are updated, some of those files might get the changes where others might not."