in reply to Database access and async web framework (like Mojolicious)
I can only speak from experience with my own web framework. Long running (background) processes keep their DB handle open (often for days on end). Web uses two different strategies: Occasional access is on-demand (XMLHttpRequest from JavaScript). Long running stuff keeps a websocket open, which means the web backend also keeps a database handle open.
I use PostgreSQL as the database. I usually connect via UDS (unix domain sockets), this is much faster and less resource intensive than TCP. Give PostgreSQL a try, it's (in my opinion) much better at dealing with hundreds of connections than SQLite, and it's also much more capable at dealing with large datasets and complicated queries¹
¹ Your application might not have reached that point yet. But that stuff has a tendency to sneak up on you. It's always better to switch to a "big" database rather sooner than later. PostgreSQL is easy to install. If you are using any kind of Linux, there's most likely a package waiting for you in your package manager.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Database access and async web framework (like Mojolicious)
by bliako (Abbot) on Dec 18, 2024 at 09:27 UTC | |
by hippo (Archbishop) on Dec 18, 2024 at 09:52 UTC | |
by bliako (Abbot) on Dec 18, 2024 at 09:57 UTC | |
by bliako (Abbot) on Dec 18, 2024 at 11:16 UTC | |
by bliako (Abbot) on Dec 23, 2024 at 16:29 UTC | |
| |
by vincent_veyron (Beadle) on Dec 19, 2024 at 18:53 UTC | |
|