remote.html   [plain text]


<!--$Id: remote.so,v 11.12 2005/06/24 05:04:09 mjc Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Remote filesystems</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Environment</dl></b></td>
<td align=right><a href="../env/encrypt.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../env/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Remote filesystems</b></p>
<p>When Berkeley DB database environment shared memory regions are backed by the
filesystem, it is a common application error to create database
environments backed by remote filesystems such as the Network File
System (NFS), Windows network shares (SMB/CIFS) or the Andrew File
System (AFS).  Remote filesystems rarely support mapping files into
process memory, and even more rarely support correct semantics for
mutexes if the mapping succeeds.  For this reason, we recommend database
environment directories be created in a local filesystem.</p>
<p>For remote filesystems that do allow remote files to be mapped into
process memory, database environment directories accessed via remote
filesystems cannot be used simultaneously from multiple clients (that
is, from multiple computers).  No commercial remote filesystem of which
we're aware supports coherent, distributed shared memory for
remote-mounted files.  As a result, different machines will see
different versions of these shared region files, and the behavior is
undefined.</p>
<p>Databases, log files, and temporary files may be placed on remote
filesystems, as long as the remote filesystem fully supports standard
POSIX filesystem semantics (although the application may incur a
performance penalty for doing so).  Further, read-only databases on
remote filesystems can be accessed from multiple systems simultaneously.
However, it is difficult (or impossible) for modifiable databases on
remote filesystems to be accessed from multiple systems simultaneously.
The reason is the Berkeley DB library caches modified database pages, and when
those modified pages are written to the backing file is not entirely
under application control.  If two systems were to write database pages
to the remote filesystem at the same time, database corruption could
result.  If a system were to write a database page back to the remote
filesystem at the same time as another system read a page, a core dump
in the reader could result.</p>
<br>
<b>FreeBSD note:</b><ul compact><li>Some historic FreeBSD releases will return ENOLCK from fsync and close
calls on NFS-mounted filesystems, even though the call has succeeded.
To support Berkeley DB on these releases, the Berkeley DB code should be modified
to ignore ENOLCK errors, or no Berkeley DB files should be placed on
NFS-mounted filesystems on these systems.  Note that current FreeBSD
releases do not suffer from this problem.</ul>
<b>Linux note:</b><ul compact><li>Some historic Linux releases do not support complete semantics for the
POSIX fsync call on NFS-mounted filesystems.  No Berkeley DB files should be
placed on NFS-mounted filesystems on these systems.  Note that current
Linux releases do not suffer from this problem.</ul>
<br>
<table width="100%"><tr><td><br></td><td align=right><a href="../env/encrypt.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../env/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>