I am helping in setting up a web service in which user data will be stored in sqlite databases on a server running perhaps Samba, and one or more web servers will read and write to those databases on the backend. I would like advice as to which network file system to use in an all-linux environment, as well as any other thoughts
4 Answers
from sqlite docs:
Also, the file locking logic of many network filesystems implementation contains bugs (on both Unix and Windows). If file locking does not work like it should, it might be possible for two or more client programs to modify the same part of the same database at the same time, resulting in database corruption.
so, be very careful! NFS in particular is well known not to follow POSIX behavior, especially about atomicity.
![](../../users/profiles/6125.webp)
- 9,078
- 2
- 23
- 24
NFS is probably your best bet. NFS is pretty configurable and will likely prove to be the best tool for the job. If you have any Windows in the mix, CIFS (Samba) is the way to go, but in an all-linux environment, NFS.
That being said, I agree with Ben S. If the only choice is sqlite (which I hope it isn't), NFS is the way go to. But a real DBMS is a much better choice.
![](../../users/profiles/21242.webp)
- 1,845
- 14
- 12
-
1Adding as Ben S' post is now gone: SQLite isn't really meant for concurrency. Any real client-server DBMS will perform better than a shared SQLite database. If it's not really meant for performance, just an occasional lookup it should be okay. – Xorlev Oct 06 '09 at 19:19
I'd suggest a real multi-user database. SQLite is the best choice for single-user apps, not multiple servers.
![](../../users/profiles/2815.webp)
- 794
- 3
- 7
- 22
This really is not what sqlite is for. It is possible but a much more robust system (and easier to maintain) would be a simple mysql installation instead of an entire fileserver.
![](../../users/profiles/190470.webp)
- 121
- 2