Answer the question
In order to leave comments, you need to log in
What's the best way to host a sqlite database on the network?
It is necessary to place the sqlite database on a resource that is connected over the network.
Now I use sshfs (the choice is random) and I encounter frequent database breakdowns, which so far have been cured.
Maybe some other protocol (smb, nfs something else) will bring more stability to my life? Only one host connects to a network resource.
PS: I know that my such scheme is not recommended, but in my case there is no choice.
Answer the question
In order to leave comments, you need to log in
>Maybe some other protocol (smb, nfs something else) will bring more stability to my life?
Will not bring
You understand that you don't actually connect to the database over the network, but download its file to yourself, and then upload it back? Naturally, if there are problems with the network, the file will deteriorate.
Either the database server or the web server (accessing that database locally) can save you.
No way. SQLite is basically not designed to work over the network.
The network SQL database must support one or another transaction isolation mechanism. Read about ACID
Based on the comments above. In your case, there is no way to decide exactly from the point of view of your Wishlist. Possible ways out of the situation:
- add (or hire a developer) software that works with the database on the client-server architecture.
- run the software that works with the database directly on the server where the database is located, and already cling to the server via vnc \ rdp
- solve with a crutch, a conditionally small script that connects to the server, pulls the database file to the local machine, starts the software, after closing the software, the script unloads the file db back to the server and if all is successful deletes the local copy of the db.
- smb\nfs won't solve the problem but should work a little better than sshfs.
Try SMB.
But the documentation explicitly warns that problems are possible when working over the network, and this cannot be completely avoided.
https://sqlite.org/lockingv3.html#how_to_corrupt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question