2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Programming model</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Architecture</dl></h3></td>
14
<td align=right><a href="../../ref/arch/bigpic.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/arch/apis.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Programming model</h1>
18
<p>Berkeley DB is a database library, in which the library is linked into the
19
address space of the application using it. The code using Berkeley DB may be
20
a standalone application or it may be a server providing functionality
21
to many clients via inter-process or remote-process communication
23
<p>In the standalone application model, one or more applications link the
24
Berkeley DB library directly into their address spaces. There may be many
25
threads of control in this model because Berkeley DB supports locking for both
26
multiple processes and for multiple threads within a process. This
27
model provides significantly faster access to the database
28
functionality, but implies trust among all threads of control sharing
29
the database environment because they will have the ability to read,
30
write and potentially corrupt each other's data.
31
<p>In the client-server model, developers write a database server
32
application that accepts requests via some form of IPC/RPC, and issues
33
calls to the Berkeley DB interfaces based on those requests. In this model,
34
the database server is the only application linking the Berkeley DB library
35
into its address space. The client-server model trades performance for
36
protection because it does not require that the applications share a
37
protection domain with the server, but IPC/RPC is slower than a function
38
call. Of course, this model also greatly simplifies the creation of
39
network client-server applications.
40
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/arch/bigpic.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/arch/apis.html"><img src="../../images/next.gif" alt="Next"></a>
42
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>