Hacker News new | past | comments | ask | show | jobs | submit login

I read in one of your Tweets that you use one database file per (unrelated) table to avoid corruption. Why did you move to this model? Are multiple tables per file really more easy to corrupt?



Yes! It kinda happened because I had no idea how SQLite worked so I thought this was normal.

Then I thought this is great and makes it easier to move the db file if it just has 1 table. So I can download it easily for local dev for ex.

And yes in case there's corruption which never rly happens, only one file thus table would be affected.

PS: one thing that really helped reduce issues was setting PRAGMA MODE to WAL


I'd be interested to know what kind of corruption you were facing.




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

Search: