Chan Chen Coding...

LDAP采用BDB作为后端数据库的理由

1.许多世界知名的大公司都采用了BDB作为多种关键性业务的后端数据库。
Sleepycat Software makes Berkeley DB, the most widely used application-specific data management software in the world with more than 200 million deployments. Customers such as Amazon, AOL, British Telecom, Cisco Systems, EMC, Ericsson, Google, Hitachi, HP, Motorola, RSA Security, Sun Microsystems, TIBCO and Veritas also rely on Berkeley DB for fast, scalable, reliable and cost-effective data management for their mission-critical applications. 
译:Sleepycat软件公司出品的Berkeley DB是一种在特定的数据管理应用程序中广泛使用的数据库系统,在世界范围内有超过两亿的用户支持.许多世界知名的厂商,像Amazon, AOL, British Telecom, Cisco Systems, EMC, Ericsson, Google, Hitachi, HP, Motorola, RSA Security, Sun Microsystems, TIBCO 以及 Veritas都依赖于BDB为他们的许多关键性应用提供快速的,弹性的,可靠的,并且高性价比的数据管理.

2.以下是chinaunix.net上一位高手给出的解释,在这里引用一下。
mysql就是用BDB实现的(mysql的后台) 。mysql快,BDB比mysql还要快N倍。
BDB并发高于RDBMS。 
容量支持可达256TB。
基于HASH支持select数据比RDBMS快。

3.BDB数据库与其它的几种数据库的比较。
BDB数据库不同与其他几种数据库--关系型(Relational databases),面向对象型(Object-oriented databases),网络数据库(Network databases),它是一种嵌入式(embeded databases)数据库。

下面先简要说说BDB与其它几种数据库的区别:
(1)它们几乎都无一例外的采用了结构化查询语言(SQL),而BDB没有。
(2)它们几乎都无一例外的采用了客户/服务器模型,而BDB采用的是嵌入式模型。

下面是在网上找的一些有关BDB的资料,解释了BDB之所以会和当前流行的大多数数据库不同的一些原因,所引资料未注明出处,后面的翻译是我自己加的:
(1)Berkeley DB is an open source embedded database library that provides scalable, high-performance, transaction-protected data management services to applications. Berkeley DB provides a simple function-call API for data access and management.
译:BDB是一个开放源代码的嵌入式数据库的函数库,它为应用程序提供弹性的,高性能的,transaction-protected的数据库管理服务,BDB为数据的访问和管理提供了简单的应用程序接口API。
(2)Berkeley DB is embedded because it links directly into the application. It runs in the same address space as the application. As a result, no inter-process communication, either over the network or between processes on the same machine, is required for database operations. Berkeley DB provides a simple function-call API for a number of programming languages, including C, C++, Java, Perl, Tcl, Python, and PHP. All database operations happen inside the library. Multiple processes, or multiple threads in a single process, can all use the database at the same time as each uses the Berkeley DB library. Low-level services like locking, transaction logging, shared buffer management, memory management, and so on are all handled transparently by the library.
译:BDB之所以是嵌入式数据库是因为它是直接连到应用程序中的。它和应用程序在同一内存空间运行。其结果是,不管应用程序是运行在同一台机器上还是运行在网络上,在进行数据库操作时,它都无需进行进程间通信。BDB为许多编程语言提供了函数接口,这些语言包括C, C++, Java, Perl, Tcl, Python, 和 PHP。所有的数据库操作都发生在函数库内部。多个进程,或者是一个进程中的多个线程,都可以同时使用BDB,因为它们实际是在调用BDB函数库。一些像locking, transaction logging, shared buffer management, memory management等等之类的低级服务都可以由函数库透明地处理。
(3)The library is extremely portable. It runs under almost all UNIX and Linux variants, Windows, and a number of embedded real-time operating systems. It runs on both 32-bit and 64-bit systems. It has been deployed on high-end Internet servers, desktop machines, and on palmtop computers, set-top boxes, in network switches, and elsewhere. Once Berkeley DB is linked into the application, the end user generally does not know that there's a database present at all.
译:BDB函数库是高度可移植的。它可以运行在几乎所有的UNIX和LINUX系统之上,也支持WINDOWS和多种嵌入式实时操作系统。它既可以运行在32位系统上,也可以运行在64位系统上。它活跃在高端服务器,桌面系统,掌上电脑,set-top boxes,网络交换机以及其它的一些领域。一旦BDB被连接到应用当中以后,终端用户一般是不知道后端数据库的存在的。
(4)Berkeley DB is scalable in a number of respects. The database library itself is quite compact (under 300 kilobytes of text space on common architectures), but it can manage databases up to 256 terabytes in size. It also supports high concurrency, with thousands of users operating on the same database at the same time. Berkeley DB is small enough to run in tightly constrained embedded systems, but can take advantage of gigabytes of memory and terabytes of disk on high-end server machines.
译:BDB在许多方面都是弹性的。函数库本身非常紧凑(在常见的机器体系上大约只占用不到300K的text空间,但是它可以操作多达256TB的数据。它也支持高强度的并发操作,可以同时允许数以千计的用户在同一个数据库进行操作。在高端服务器领域,BDB是足够小的,它可以在高度受限的嵌入式系统上运行,但却可以利用高达GB量级的内存空间和高达TB量级的磁盘空间。
(5)Berkeley DB generally outperforms relational and object-oriented database systems in embedded applications for a couple of reasons. First, because the library runs in the same address space, no inter-process communication is required for database operations. The cost of communicating between processes on a single machine, or among machines on a network, is much higher than the cost of making a function call. Second, because Berkeley DB uses a simple function-call interface for all operations, there is no query language to parse, and no execution plan to produce.
译:BDB在嵌入式应用方面的性能比关系型数据库和面向对象的数据库优越的原因是多方面的。首先,因为函数库和应用是运行在同一地址空间中的,省掉了数据库操作时的进程间通信。而众所周知,不管是在单机上还是在分布式系统上,进程间通信所花的时间远多于函数调用所要的时间。其次,因为BDB对所有的操作提供了简洁的函数调用接口,无需对查询语言进行解析,也不需要预执行。
(6)In contrast to most other database systems, Berkeley DB provides relatively simple data access services.Berkeley DB supports only a few logical operations on records. They are:

Insert a record in a table. 
Delete a record from a table. 
Find a record in a table by looking up its key. 
Update a record that has already been found. 
译:与其他大多数数据库系统相比,BDB提供了相对简单的数据访问服务。BDB只支持对记录所做的几种逻辑操作。它们是:

在表中插入一条记录。
从表中删除一条记录。
通过查询键(key)从表中查找一条记录。
更新表中已有的一条记录。
(7)Berkeley DB is not a standalone database server. It is a library, and runs in the address space of the application that uses it.It is possible to build a server application that uses Berkeley DB for data management. For example, many commercial and open source Lightweight Directory Access Protocol (LDAP) servers use Berkeley DB for record storage. LDAP clients connect to these servers over the network. Individual servers make calls through the Berkeley DB API to find records and return them to clients. On its own, however, Berkeley DB is not a server.
译:BDB不是一个独立的数据库服务器。它是一个函数库,和调用它的应用程序是运行在同一地址空间中的。可以把BDB作为数据库管理系统来构建服务器程序。比如,有许多商业的和开源的轻量级目录访问协议(LDAP)服务器都使用BDB存储记录。LDAP客户端通过网络连接到服务器。服务器调用BDB的API来查找记录并返回给客户。而在它本身而言,BDB却不是数据库的服务器端。
所以,BDB是一种完全不同于其它数据库管理系统的数据库,而且它也不是一个数据库服务器端。

4.BDB的优点和缺点。
Berkeley DB is an ideal database system for applications that need fast, scalable, and reliable embedded database management. For applications that need different services, however, it can be a poor choice.
Berkeley DB was conceived and built to provide fast, reliable, transaction-protected record storage. The library itself was never intended to provide interactive query support, graphical reporting tools, or similar services that some other database systems provide.We have tried always to err on the side of minimalism and simplicity. By keeping the library small and simple, we create fewer opportunities for bugs to creep in, and we guarantee that the database system stays fast, because there is very little code to execute. If your application needs that set of features, then Berkeley DB is almost certainly the best choice for you.
译:当面对的是对性能,规模和可靠性要求都比较高的嵌入式应用的时候,BDB是理想的数据库管理系统。但对于要求多种不同服务的应用而言,选择它是不适当的。
BDB的初衷是提供快速的,可靠的,transaction-protected的记录存储。函数库本身并没有提供对交互查询的支持,也没有提供图形化的报表工具,或者一些其它的数据库管理系统提供的服务。我们一直在致力于保持函数库的短小和简练,这样做,可以使得bug出现的机会大大减小,而且因为只有很少的代码需要执行,我们可以保证数据库一直快速的运行。如果你的应用正好需要的是这样的一套功能的话,那么BDB几乎一定是你的首选对象。

5.我个人的观点
BDB之所以适合LDAP,一个关键的因素是它可以保证LDAP的快速响应.因为BDB本身是一种嵌入式的数据库,速度快是它最大的特点,也是它和其他数据库系统相比最大的优势.我们再来看LDAP,LDAP是一种一旦数据建立就很少需要改动的数据库,并且它最常用的操作是读取,查询,搜索等等不改变数据库内容的操作.而让BDB来做这几种事情无疑是最好的选择.这样,即使在有大量用户提交数据库查询的情况下,LDAP仍能快速反馈给用户有用信息.所以,速度的考虑是LDAP选用BDB的最大因素.这也是目前绝大多数的LDAP服务器都选用BDB的根本原因. 

-----------------------------------------------------
Silence, the way to avoid many problems;
Smile, the way to solve many problems;

posted on 2012-05-03 11:38 Chan Chen 阅读(932) 评论(0)  编辑  收藏 所属分类: DB


只有注册用户登录后才能发表评论。


网站导航: