3 ms·
SQLite is an SQL database engine. Using it for storing a single value is like attacking a fly with a nuclear weapon. Unless you are talking about a function in
by twa927 10y ago
SQLite is an SQL database engine. Using it for storing a single value is like attacking a fly with a nuclear weapon.
Unless you are talking about a function in the SQLite library that implements the durability calls properly and can be called from other programs.
- rwmj 10y agoYou should use SQLite whenever you are tempted to write some data and you have any expectations to be able to read back that data. That applies even for a single value although most programs will store more than just a single value.
- robotresearcher 10y agoSQLite stores data on disk in a file.
- rwmj 10y agoEr, yes, that's the point.
- tremon 10y agoI think his point was that SQLite still has to work around the durability problem described in the article. As such, SQLite isn't a solution, it's a middleware API. I'm not trying to knock it, but solving a problem by adding a new layer isn't good design. Also, middleware shouldn't be needed in open source because you can simply patch the underlying API. That the middleware is the best solution in this case says a lot about the problem.
- rwmj 10y agoSQLite does solve the problem because it knows exactly what fsync()/fdatasync()/whatever calls are necessary to persist a file, and it also knows that for the many operating systems that SQLite is implemented on. It's also tested regularly. I can't believe the level of ignorance in this thread.
- robotresearcher 10y agoSo the reliability and storage semantics bottom out at the filesystem after all. It's not as simple as 'I'll use SQLite: problem solved'. Not for the authors of SQLite, for sure.
- rwmj 10y agoThe point is: the authors of SQLite solved that problem. Properly. For many more OSes than you or I will ever see. And they test it.
- memracom 10y agoIf you do not want to use SQLITE to solve this problem then download the SQLITE source code and copy the way that they achieve these guarantees. Stand on the shoulders of the giants who have come before us.