Will an SQLite database perform well to around 50 reads/second without locking?
I'm trying to decide whether it'd be feasible for use on a PHP website that won't get 'written' to very often - it'll be mostly reads of the same data from a small handful of tables
Concurrency in SQLiteSQLite (and RSQLite) supports concurrent access to the same database, through multiple database connections, possibly from multiple processes.
SQLite Version 3.0. 0 introduced a new locking and journaling mechanism designed to improve concurrency over SQLite version 2 and to reduce the writer starvation problem. The new mechanism also allows atomic commits of transactions involving multiple database files.
High Concurrency SQLite supports an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time. For many situations, this is not a problem. Writers queue up. Each application does its database work quickly and moves on, and no lock lasts for more than a few dozen milliseconds.
SQLite is capable of creating databases that are held entirely in memory. This is extremely useful for creating small, temporary databases that require no permanent storage. In-memory databases are often used to cache results pulled from a more traditional RDBMS server.
No problem. The concurrent reading/writing will actually be serialized by SQLite so you don't need to care about it.
For details : http://www.sqlite.org/lockingv3.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With