3 ms·
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
by bravura 6y ago
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?
- robjan 6y agoSQLLite will lock the db while you are writing to it to prevent this happening
- lukeschlather 6y agoIt'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.