← Back to context

Comment by h4kor

2 days ago

The main reason I use postgres instead of SQLite is that I have multiple processes accessing the database, often 1 web service for API/Website and a worker running in the background doing heavy tasks (e.g. image processing). Both need access to the database and SQLite will run into locking issues.

How do you overcome this with SQLite and Django?

Afaik the fix for that is to have multiple read only connections and one write only connection.

  • Yes by enabling the write ahead log feature: https://sqlite.org/wal.html

    It's on by default in many sqlite drivers because it really is the best default. But it isn't on by default in upstream sqlite even though it's been out for ages now.

    • Sure but if you're dealing with WAL logs, why not just go Postgres? Then you also get a port you can connect to from remote machines if you need.

      3 replies →