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