To that goal, I think it's wildly successful, instead of writing files I almost always reach for SQLite first.
When systems share a database, I, like you, reach straight for postgresql. Most people reach for mysql, which I do not prefer.
To that goal, I think it's wildly successful, instead of writing files I almost always reach for SQLite first.
When systems share a database, I, like you, reach straight for postgresql. Most people reach for mysql, which I do not prefer.
This bug has occurred to me personally multiple times.
Does it really have advantages over a flat file?
I think the odds are likely that Firefox is doing something unsuspected.
https://www.sqlite.org/testing.html
- Four independently developed test harnesses
- 100% branch test coverage in an as-deployed configuration
- Millions and millions of test cases
- Out-of-memory tests
- I/O error tests
- Crash and power loss tests
- Fuzz tests
- Boundary value tests
- Disabled optimization tests
- Regression tests
- Malformed database tests
- Extensive use of assert() and run-time checks
- Valgrind analysis
- Undefined behavior checks
- Checklists
It seems that about once a month I read something that makes me like SQLite even more. I guess that they like Valgrind as much as I do is the reason this month.
<<This bug has occurred to me personally multiple times.>>
Hello, I am AirBus engineer (not really, only pretend). Does my plane crash? No, it does not!
Dear Random Internet Person who complains that open source software is broken. Are you joking? We are talking about SQLite!!??
SQLite has whole pages dedicated to "why you should NOT use SQLite". How many open source projects are /so/ good they can do this? Incredible!
The test coverage feels like NASA.
Whatever capabilities SQLLite has to recover corrupted or inconsistent storage, it certainly exceeds what you get with flat files (none, unless you implement it yourself).
Which suggests an application error to me. I'd give decent odds to the real problem being some bounds check or pointer writing to the wrong place. To prove it, I'd instrument SQLite to log every single query that it was asked to do, then try to run those queries outside of the application. If the queries work fine, then the copy of SQLite in the application is being corrupted somehow.
In which case it really isn't fair to blame SQLite.
The question is how it is getting corrupted. Is it that SQLite has a bug? Or the copy of SQLite in Firefox is getting corrupted first?
Given the complexity and relative levels of testing of those two products, my bet is that the problem is Firefox.
Interestingly enough, I don't think I've ever had this issue. I've force quit Firefox many times in the past (not often, but I'm sure I've done it countless times in the 10+ years I've been using it) and I still have localStorage data intact. There's old crap in StackEdit.io, which uses localStorage, that I haven't touched in years. (no, I have neither that service or Firefox itself set up to sync with anything)
EDIT: Maybe it's OS specific? I've been on macOS, and maybe there's something about other file systems where corruption is more likely to happen with a force-quit? Just throwing darts here.
I've never seen any error messages from Firefox suggesting that anything has been corrupted.
Are there other symptoms that I would expect to see, if this corruption is happening?
SQLite is really only my first choice for hobby projects and desktop apps that aren't running on the JVM.
I hear this too - but silently truncating my data (causing a great deal of data loss and grief for me) is likely going to continue to bias me against MySQL for the foreseeable future.
Compatibility with old decisions vs. doing the right thing™ is always a pain ...
I'm not saying I'm being rational in holding my grudge. I got bit by that "bug" _bad_ early in my career and the scar tissue lingers.
I still believe Sqlite is the appropriate store. Unless.. does Git handle power issues elegantly? What happens if you yank power in the middle of a commit? Sqlite is designed to handle that.
- A - yes, update HEAD/branch text file is the key atomic update
- C - not sure how to apply this in the context of git, because commited files' content is kinda free form by design, no schema, no consistency problems
- I - there should not be concurrent use of commands, so no. practically this is mostly important for pushing to remote repository, and there it's handled by rejecting the push that comes second, if you make two commits from the same base and push them at the same time
- D - yes
... but it was so slow compared to git! at everything. merging, pushing, pulling ...
you did not experience same?
my main beef with fossil was performance. but i should clarify that this was 5 years ago or so. so maybe it's ok now.
I never programmed for berkelyDB but I don’t believe it was SQL, so I think that’s what made SQLite so successful. The combination of an SQL api backed by local files
There is a lot of macOS/iOS software using Core Data who already have "SQLite as an application document storage model" without even realizing it.