开发者

sqlite over network share for failover

As a follow-up of this 开发者_开发问答question: sqlite-over-a-network-share

If I put the SQlite DB on a network share, but will not access it concurrently from different machines. I only have the SQLite db stored on a share so a cluster of failover computers can take over where one machine left off.

Are there any inherent problems with that approach?


Interested in knowing your experiences (After 5 years). Per Eric Grange's helpful hint:

  • "SQLite uses POSIX advisory locks to implement locking on Unix"... "POSIX advisory locking is known to be buggy or even unimplemented on many NFS implementations" ... "Your best defense is to not use SQLite for files on a network filesystem."

  • Having said that, if your NFS server is rock-solid (ie, NetApp) and your clients are rock-solid (ie, probably not Linux; see for instance http://nfsworld.blogspot.co.at/2006/10/review-of-why-nfs-sucks-paper-from.html).

  • POSIX advisory locking over NFS is also impelmentation-dependent: From the File locking Wikipedia article: "On Linux prior to 2.6.12, flock calls on NFS files would act only locally. Kernel 2.6.12 and above implement flock calls on NFS files using POSIX byte-range locks. These locks will be visible to other NFS clients that implement fcntl-style POSIX locks, but invisible to those that do not." If there's doubt, you can use nfstrace to determine what your OS is trying to do.

  • What happens if node A has begun a transaction, locked the table-file, then crashed? Will node B see the advisory lock and refuse to write to the file?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜