4 ms·
Well, running multiple instances of the same app is not only about "points of failure", it's also about using all the cores of your machine. Typically, using PI
by TheRoque 2y ago
Well, running multiple instances of the same app is not only about "points of failure", it's also about using all the cores of your machine. Typically, using PI (nodejs), Docker or Uvicorn (python), you can spin up multiple instances of your backend to handle more concurrently.
- Filligree 2y agoSQLite connections can be used concurrently inside a single process. You can spin up more threads instead, and spare yourself the filesystem locking overhead.
- TheRoque 2y agoThreads in Python in python are locked to a single core, and in NodeJS it's really annoying to pull off. That's why people use PM2, Uvicorn and Gunicorn.
- Filligree 2y agoThat would be a problem, then. I'm always surprised when people try to write high-performance code in Python or JS.
- TheRoque 2y agoNobody talked about "high performance". I'm just talking about using all the cores on a machine. People write stuff in Python and JS for obvious reasons that I don't need to detail here.
- Filligree 2y agoPerformance is best judged on a logarithmic scale. Most software barely needs any, and there are many orders of magnitude between "barely uses the CPU" and "uses 100% of a core". But once you're at 100% of a core, then there aren't many orders of magnitude between that and "uses every core". In fact, the impact from not using a scripting language is on the same order as the threading would be! So, if it's worth spending effort squeezing out those last 1-2 orders of magnitude from the CPU, then it's probably worth thinking about the language as well. If you've already blown through 4-5 OOMs going to a full core, then chances are you'll need it.
- carom 2y agoThis is why I don't write serious applications in Python and Node.
- GauntletWizard 2y agoSQlite handles concurrency "fine"; If you have long-lived locks, it can be a hassle, because that's still fundamentally single-threaded, but you can have as many processes accessing the same database as you want so long as their locks don't overlap. If you're mostly reading, it's great.