Putting the database file on a network share

Hi. Is it possible/sensible/advisable to put the database file on a network share so that it can be used by both my desktop PC and my laptop PC? I want to be able to use Digikam on both of those PCs (one at a time!) without having to do everything twice. Many thanks for any suggestions/help.

You probably need to run a mysql database if you want to more than one person at a time to access it. The default is sqlite, which is file based, and thus probably can’t be opened by multiple clients.

No. This is specifically warned against. Do not put the Sqlite database
files on a network drive. You can do MySql over a network but even with
that there is no locking to keep it safe from simultaneous access. You
might be OK with only accessing one at a time but you have to be very
sure about that. You also need to have a solution for making sure each
PC will work with the AlbumRoot entry.

Andrew

2 Likes

Thank you for your response. My assumption was that a single database file, sharable between the two computers on my network, but not at the same time, would be the right way to do things, but it seems not.

Could you explain the difference between sqllite and mysql in this context and how I would achieve one or the other? Also, can you comment further on the AlbumRoot entry issue you mention?

What exactly is in the database file? If I had a separate databse file on each computer, how much would I have to do twice to have the same experience on both PCs?

Many thanks for any further help you’re willing to offer.

Client/Server Applications
If there are many client programs sending SQL to the same database over a network, then use a client/server database engine instead of SQLite. SQLite will work over a network filesystem, but because of the latency associated with most network filesystems, performance will not be great. Also, file locking logic is buggy in many network filesystem implementations (on both Unix and Windows). If file locking does not work correctly, two or more clients might try to modify the same part of the same database at the same time, resulting in corruption. Because this problem results from bugs in the underlying filesystem implementation, there is nothing SQLite can do to prevent it.
A good rule of thumb is to avoid using SQLite in situations where the same database will be accessed directly (without an intervening application server) and simultaneously from many computers over a network.

Source: Appropriate Uses For SQLite

Sorry for the necropost (one month) but since there’s some potential for data loss, I thought it might be a good idea.