Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Supposing that your server-side tech uses multiple workers to render pages, I suppose you have to serialize the access to the SQLite file. What is the best way to do this?


SQLite can handle concurrent reads, but needs to lock the entire DB when writing. Multiple workers shouldn't be a problem per se, but if you need multiple workers to support the traffic, then maybe a client-server db like postgres is a better choice.


Writing does not lock readers if you use the WAL feature (Write-Ahead Log, introduced in 2010)

https://sqlite.org/wal.html

> WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.


Right. I meant it doesn't support concurrent writes.


On any personal website, that shouldn't be much of a problem, most blogs have only a few writes at a time




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact