Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SQLite lock the database file on reads?

Tags:

sqlite

I'm investigating SQLite as a storage engine, and am curious to know whether SQLite locks the database file on reads.

I am concerned about read performance as my planned project will have few writes, but many reads. If the database does lock, are there measures that can be taken (such as memory caching) to mitigate this?

like image 791
Josiah Avatar asked Jun 17 '09 05:06

Josiah


1 Answers

You can avoid locks when reading, if you set database journal mode to Write-Ahead Logging (see: http://www.sqlite.org/wal.html).

like image 112
Tombo Avatar answered Sep 20 '22 17:09

Tombo