SQLite with two python processes accessing it: one reading, one writing
Posted
by
BBnyc
on Programmers
See other posts from Programmers
or by BBnyc
Published on 2013-10-08T16:19:35Z
Indexed on
2013/10/31
22:17 UTC
Read the original article
Hit count: 322
I'm developing a small system with two components: one polls data from an internet resource and translates it into sql data to persist it locally; the second one reads that sql data from the local instance and serves it via json and a restful api.
I was originally planning to persist the data with postgresql, but because the application will have a very low-volume of data to store and traffic to serve, I thought that was overkill. Is SQLite up to the job? I love the idea of the small footprint and no need to maintain yet another sql server for this one task, but am concerned about concurrency.
It seems that with write ahead logging enabled, concurrently reading and writing a SQLite database can happen without locking either process out of the database.
Can a single SQLite instance sustain two concurrent processes accessing it, if only one reads and the other writes? I started writing the code but was wondering if this is a misapplication of SQLite.
© Programmers or respective owner