Hacker News new | ask | show | jobs
by alttab 5778 days ago
SQLite is a file and thus uses file-level locking and does not have row-level locking. Data can not be read the same time anything is being written, so it is usually not great for multi-user applications or web applications.

Development, or 1-3 user web app it should perform OK. It doesn't scale and you will get db locks and retries if its under too much load.

To speed this up (if you must use SQLite), use a solid state drive as I/O performance is the biggest bottleneck.

2 comments

http://linux.die.net/man/2/fcntl

actually it could use row-level locking since it uses row-oriented storage and fcntl locks can be applied to a set of bytes within a file. it could also do file-level locking on tempfiles with names derived from the table name and primary key of the row.

anyone with actual knowledge of it care to chime in with what it does do?

I have actual knowledge of it. The product I work on uses it as the production database because we distribute the software as a desktop application (and MySQL has licensing issues).

It COULD do row level locking, but it doesn't. SQLitening is the closest thing to performant SQLite you will get. And it only runs on Windows.

Thanks for clarifying what I suspected. If you don't need high concurrency, it's a champ.