View Single Post
Old 01-03-2021, 03:39 PM   #1
haertig
Wizard
haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.
 
Posts: 1,897
Karma: 31522252
Join Date: Sep 2017
Device: PW3, Fire HD8 Gen7, Moto G7, Sansa Clip v2, Ruizu X26
Thoughts on implementing a networked Calibre database

Will Calibre work with an overlay file system (e.g., OverlayFS in Linux)?

I would like to share my Calibre database read-only over a network. I know, "Bad, bad, bad - you're on your own down the Highway To Hell, you idiot" will be the standard response I expect to hear. But read what I'm proposing.

What I'm thinking is:

(1) Calibre database on Computer A

(2) Network share of Computer A's database to Computer B, mounted read-only on Computer B

(3) OverlayFS implemented on Computer B - the "lower layer" being the read-only remote mount from Computer A, the "upper layer" being a read-write directory on Computer B (a local directory)

(4) Run Calibre on Computer B using the overlayed file system as its database

The above assumes that OverlayFS can successfully use a remote mount as the "lower layer", and a local directory as the "upper layer", of an overlay file system. I have never tried this, but until I get a chance to research it further I am assuming that it will work.

It appears that this would protect the main database (on Computer A) from corruption due to Calibre activity on Computer B, since the main database is read-only on Computer B.

I also appears that Calibre on Computer B should not balk at a read-only database because it is actually using a read-write layer on top of the actual database.

If Calibre on Computer B corrupted anything, it should theoretically corrupt only the local read-write layer. To fix any corruption, just stop Calibre on Computer B, tear down the overlay file system, delete the read-write layer directory, recreate the overlay file system, and restart Calibre. This is fine, because we really only wanted Calibre on Computer B to have read-only access to its database. Anything it tried to write, or corrupted by accident, can be safely discarded.

But hopefully Calibre on Computer B would not corrupt anything, because it's kind of on an island all by itself being the sole player with it's local read-write layer. That is, unless Calibre has some inherent problem with using an overlay file system.

Does this overlay approach have any chance of success as a kludgy solution to the "shared read-only remote database" use case for Calibre?
haertig is offline   Reply With Quote