I'm interested in using SQLite with AFS (the Andrew FileSystem).
Unlike NFS, AFS has solid, reliable support for *whole-file* advisory
locking across the network.

AFS does some very sophisticated caching, so an SQLite database in AFS
accessed by a single reader/writer would be very efficient.  A second
reader/writer would cause performance to degrade by breaking callbacks
quite often, but as long as whole-file locking is used, no corruption
should occur.

I think a scenario where a database is accessed mostly by a single
process but occasionally updated by other clients (for example, for
administration) would work really well.  In a lot of applications
(like the one I'm considering) this would eliminate the need for an
"administration API" implemented on the main reader/writer --
administration could be done using the sqlite3 binary directly on the
database across AFS.

I read through the locking code:

  http://www.srcdoc.com/sqlite_3.2.2/os__unix_8c-source.html#l00911

It looks like it would be possible to do the locking with whole-file
locks on three separate files (less elegant, certainly) rather than
byte range locks if one gave up support for old versions of Windows.

Does this sound like it would work?  Can anybody see any way to do it
with less than three files?  AFS offers both read-locks and
exclusive-write-locks on all platforms via fcntl().

  - a

-- 
PGP/GPG: 5C9F F366 C9CF 2145 E770  B1B8 EFB1 462D A146 C380

Reply via email to