News for hackers. Stuff that matters.
Re:Pieter Levels Makes $600k a Year from Nomad List and Remo... by bravura on Monday August 24, 2020 @08:21AM (#24259888)
If I have a simple Flask or Django app, backed by sqlite, how do I make sure I only have one client? If I use a prerolled Apache or Nginx frontend (which may or may not be set up with multiple threads or whatever), and have very very low traffic, how do I make sure I'm not corrupting it with multiple writes?
Re:Pieter Levels Makes $600k a Year from Nomad List and Remo... by lukeschlather on Monday August 24, 2020 @09:54AM (#24260643)
It's probably fine to leave Apache or Nginx with multiple threads (probably even a good idea) but you need to make sure that uwsgi or whatever Python server you're using on the backend only has one process.

If you can somehow architect things so a single process is doing writes (but leave multiple processes doing reads) that's likely even better.

However I would suggest doing a lot of testing. It's possible multiple write processes isn't the end of the world below some threshold.

Re:Pieter Levels Makes $600k a Year from Nomad List and Remo... by robjan on Monday August 24, 2020 @08:45AM (#24260053)
SQLLite will lock the db while you are writing to it to prevent this happening