青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

[意譯]Berkeley DB 文檔 - C++入門篇 - 1.2節(jié) - Berkeley DB 概述

譯者序(轉(zhuǎn)載 -- Berkeley DB簡介):

    Berkeley DB是由美國Sleepycat Software公司開發(fā)的一套開放源碼的嵌入式數(shù)據(jù)庫的程序庫(database library),它為應(yīng)用程序提供可伸縮的、高性能的、有事務(wù)保護(hù)功能的數(shù)據(jù)管理服務(wù)。Berkeley DB為數(shù)據(jù)的存取和管理提供了一組簡潔的函數(shù)調(diào)用API接口。
    
    它是一個經(jīng)典的C-library模式的toolkit,為程序員提供廣泛豐富的函數(shù)集,是為應(yīng)用程序開發(fā)者提供工業(yè)級強度的數(shù)據(jù)庫服務(wù)而設(shè)計的。其主要特點如下:

    嵌入式(Embedded):它直接鏈接到應(yīng)用程序中,與應(yīng)用程序運行于同樣的地址空間中,因此,無論是在網(wǎng)絡(luò)上不同計算機之間還是在同一臺計算機的不同進(jìn)程之間,數(shù)據(jù)庫操作并不要求進(jìn)程間通訊。

    Berkeley DB為多種編程語言提供了API接口,其中包括C、C++、Java、Perl、Tcl、Python和PHP,所有的數(shù)據(jù)庫操作都在程序庫內(nèi)部發(fā)生。多個進(jìn)程,或者同一進(jìn)程的多個線程可同時使用數(shù)據(jù)庫,有如各自單獨使用,底層的服務(wù)如加鎖、事務(wù)日志、共享緩沖區(qū)管理、內(nèi)存管理等等都由程序庫透明地執(zhí)行。

    輕便靈活(Portable):它可以運行于幾乎所有的UNIX和Linux系統(tǒng)及其變種系統(tǒng)、Windows操作系統(tǒng)以及多種嵌入式實時操作系統(tǒng)之下。它在32位和64位系統(tǒng)上均可運行,已經(jīng)被好多高端的因特網(wǎng)服務(wù)器、臺式機、掌上電腦、機頂盒、網(wǎng)絡(luò)交換機以及其他一些應(yīng)用領(lǐng)域所采用。一旦 Berkeley DB被鏈接到應(yīng)用程序中,終端用戶一般根本感覺不到有一個數(shù)據(jù)庫系統(tǒng)存在。

    可伸縮(Scalable):這一點表現(xiàn)在很多方面。Database library本身是很精簡的(少于300KB的文本空間),但它能夠管理規(guī)模高達(dá)256TB的數(shù)據(jù)庫。它支持高并發(fā)度,成千上萬個用戶可同時操縱同一個數(shù)據(jù)庫。Berkeley DB能以足夠小的空間占用量運行于有嚴(yán)格約束的嵌入式系統(tǒng),也可以在高端服務(wù)器上耗用若干GB的內(nèi)存和若干TB的磁盤空間。

    Berkeley DB在嵌入式應(yīng)用中比關(guān)系數(shù)據(jù)庫和面向?qū)ο髷?shù)據(jù)庫要好,有以下兩點原因:

    (1)因為數(shù)據(jù)庫程序庫同應(yīng)用程序在相同的地址空間中運行,所以數(shù)據(jù)庫操作不需要進(jìn)程間的通訊。在一臺機器的不同進(jìn)程間或在網(wǎng)絡(luò)中不同機器間進(jìn)行進(jìn)程通訊所花費的開銷,要遠(yuǎn)遠(yuǎn)大于函數(shù)調(diào)用的開銷;

    (2)因為Berkeley DB對所有操作都使用一組API接口,因此不需要對某種查詢語言進(jìn)行解析,也不用生成執(zhí)行計劃,大大提高了運行效.

正文

Berkeley DB Documentation -- C++ Getting Started Guide
Berkeley DB 文檔 -- C++入門篇

Berkeley DB Concepts
Berkeley DB 概述

Before continuing, it is useful to describe some of the larger concepts that you will encounter when building a DB application.

先看看構(gòu)建一個DB應(yīng)用時你可能遇到的一些概念.

Conceptually, DB databases contain records. Logically each record represents a single entry in the database. Each such record contains two pieces of information: a key and a data. This manual will on occasion describe a a record's key or a record's data when it is necessary to speak to one or the other portion of a database record.

概念上說,DB數(shù)據(jù)庫包含了記錄(records),每條技術(shù)是一個邏輯上的實體.這種記錄通常包含兩部分的信息,鍵和值.本手冊會適當(dāng)?shù)臅r候來進(jìn)一步說明.

Because of the key/data pairing used for DB databases, they are sometimes thought of as a two-column table. However, data (and sometimes keys, depending on the access method) can hold arbitrarily complex data. Frequently, C structures and other such mechanisms are stored in the record. This effectively turns a 2-column table into a table with n columns, where n-1 of those columns are provided by the structure's fields.

根據(jù)鍵值對的DB數(shù)據(jù)庫模型,我們有時會認(rèn)為它是一個只有兩列的表.然而,值(有時也可以是鍵,這由訪問的方式?jīng)Q定)可以是一種復(fù)雜的數(shù)據(jù)結(jié)構(gòu).通常,記錄中保存的是C的結(jié)構(gòu)體或一些類似的東西.這種方式有效的把2列的表轉(zhuǎn)變?yōu)閚列的表,其中n-1列是由結(jié)構(gòu)體提供.

Note that a DB database is very much like a table in a relational database system in that most DB applications use more than one database (just as most relational databases use more than one table).

注意,我們這里的DB數(shù)據(jù)庫和關(guān)系數(shù)據(jù)庫中的表十分類似,絕大部分DB應(yīng)用使用不只一個數(shù)據(jù)庫(正如大部分關(guān)系數(shù)據(jù)庫不只一個表).

Unlike relational systems, however, a DB database contains a single collection of records organized according to a given access method (BTree, Queue, Hash, and so forth). In a relational database system, the underlying access method is generally hidden from you.

但與關(guān)系系統(tǒng)不同的是,DB數(shù)據(jù)庫可以通過指定方式(B樹,隊列,哈希,諸如此類)訪問一個的數(shù)據(jù)集.在關(guān)系數(shù)據(jù)庫系統(tǒng)中,這些隱藏的訪問方式通常是用戶不可見的.

In any case, frequently DB applications are designed so that a single database stores a specific type of data (just as in a relational database system, a single table holds entries containing a specific set of fields). Because most applications are required to manage multiple kinds of data, a DB application will often use multiple databases.

基本上,常用的DB應(yīng)用設(shè)計是一個單獨的數(shù)據(jù)庫來保存一個特定的數(shù)據(jù)類型(正如關(guān)系數(shù)據(jù)庫中,一張單獨的表包含一種特定的集合).由于一個程序通常要包含多種數(shù)據(jù)類型,一個DB應(yīng)用通常也使用多個數(shù)據(jù)庫.

For example, consider an accounting application. This kind of an application may manage data based on bank accounts, checking accounts, stocks, bonds, loans, and so forth. An accounting application will also have to manage information about people, banking institutions, customer accounts, and so on. In a traditional relational database, all of these different kinds of information would be stored and managed using a (probably very) complex series of tables. In a DB application, all of this information would instead be divided out and managed using multiple databases.

比如,想像一個賬目程序.這種程序可以管理銀行帳號,支票帳號,股票,債券,貸款等等.一個賬目程序還需要管理用戶,用戶帳戶,銀行等等的信息.在傳統(tǒng)的關(guān)系數(shù)據(jù)庫中,所有的這些信息可能通過一系列(也許非常非常)復(fù)雜的表來保存和管理.在DB應(yīng)用中,所有的這些信息則被分離,用多個數(shù)據(jù)庫來管理.

DB applications can efficiently use multiple databases using an optional mechanism called an environment. For more information, see Environments.

DB應(yīng)用可以通過一種可選的叫做"環(huán)境(environment)"機制來有效的使用多個數(shù)據(jù)庫.更多內(nèi)容參見"Environments"章節(jié).

You interact with most DB APIs using special structures that contain pointers to functions. These callbacks are called methods because they look so much like a method on a C++ class. The variable that you use to access these methods is often referred to as a handle. For example, to use a database you will obtain a handle to that database.

你通過使用特定包含指針和函數(shù)的結(jié)構(gòu)體和DB的API互交.這些回調(diào)和C++中類的method看上去很像,因此被稱為方法(methods).
用來訪問方法的變量通常是一個句柄(handle).比如,使用一個數(shù)據(jù)庫,你必須獲得一個數(shù)據(jù)庫的句柄.

Retrieving a record from a database is sometimes called getting the record because the method that you use to retrieve the records is called get(). Similarly, storing database records is sometimes called putting the record because you use the put() method to do this.

從數(shù)據(jù)庫中找回一條記錄有時被稱為get一條記錄,原因是找回記錄的方法是get().類似保存一條記錄有時被稱為put一條記錄,因為相應(yīng)的方法是put().

When you store, or put, a record to a database using its handle, the record is stored according to whatever sort order is in use by the database. Sorting is mostly performed based on the key, but sometimes the data is considered too. If you put a record using a key that already exists in the database, then the existing record is replaced with the new data. However, if the database supports duplicate records (that is, records with identical keys but different data), then that new record is stored as a duplicate record and any existing records are not overwritten.

當(dāng)你通過句柄保存,或者說是put一條記錄,這條記錄通過數(shù)據(jù)庫指定的順序被插入.順序主要是由鍵來確定,但有時值也是被考慮的因素.如果你put了一個鍵已經(jīng)存在的記錄,它會用新的數(shù)據(jù)替換原有數(shù)據(jù).然而,如果數(shù)據(jù)庫支持多重(duplicate)記錄(也就是說鍵同值不同),那么新的記錄會作為另一個副本保存.

If a database supports duplicate records, then you can use a database handle to retrieve only the first record in a set of duplicate records.

如果數(shù)據(jù)庫支持多重記錄,你可以通過數(shù)據(jù)庫找回多重記錄集中的第一條記錄.

In addition to using a database handle, you can also read and write data using a special mechanism called a cursor. Cursors are essentially iterators that you can use to walk over the records in a database. You can use cursors to iterate over a database from the first record to the last, and from the last to the first. You can also use cursors to seek to a record. In the event that a database supports duplicate records, cursors are the only way you can access all the records in a set of duplicates.

再提一點關(guān)于數(shù)據(jù)庫句柄使用,你可以通過一種叫做游標(biāo)(cursor)的特定機制來讀/寫數(shù)據(jù).游標(biāo)本質(zhì)上是用來遍歷數(shù)據(jù)庫中記錄的迭代器(iterator).你可以使用游標(biāo)來查詢記錄.在數(shù)據(jù)庫支持多重記錄的情況下,游標(biāo)是唯一可以訪問這些記錄副本集的方式.

Finally, DB provides a special kind of a database called a secondary database. Secondary databases serve as an index into normal databases (called primary database to distinguish them from secondaries). Secondary databases are interesting because DB records can hold complex data types, but seeking to a given record is performed only based on that record's key. If you wanted to be able to seek to a record based on some piece of information that is not the key, then you enable this through the use of secondary databases.

最后,DB提供了一種特殊的數(shù)據(jù)庫叫做次級(secondary)數(shù)據(jù)庫.次級數(shù)據(jù)庫作為普通數(shù)據(jù)庫(為了區(qū)別,稱他為主數(shù)據(jù)庫)的索引而存在.由于DB數(shù)據(jù)庫可以保存復(fù)雜的數(shù)據(jù)結(jié)構(gòu),但是查詢時只能通過記錄的鍵.如果你想通過不是鍵的部分進(jìn)行查詢,就需要通過次級數(shù)據(jù)庫來實現(xiàn)了.
posted on 2007-05-10 10:49 張沈鵬 閱讀(886) 評論(0)  編輯 收藏 引用 所屬分類: C++
 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美激情视频一区二区三区在线播放| 欧美大胆a视频| 欧美一区二区三区在线看| 亚洲电影在线播放| 久久蜜桃精品| 久久精品国产久精国产一老狼| 亚洲每日更新| 91久久精品一区二区三区| 欧美在线观看日本一区| 亚洲一区二区三区在线| 亚洲香蕉网站| 亚洲午夜影视影院在线观看| 亚洲片区在线| 亚洲精选在线| 在线视频欧美日韩| 亚洲欧美国产制服动漫| 亚洲欧美日韩区| 欧美一级电影久久| 久久精品国产久精国产思思| 久久久久久久久久码影片| 久久久久九九视频| 欧美不卡视频一区| 亚洲精品国产精品乱码不99| 麻豆精品在线播放| 亚洲第一精品福利| 91久久精品一区| 亚洲伊人网站| 午夜免费日韩视频| 久久综合九色综合欧美狠狠| 欧美人成在线| 国产日韩欧美制服另类| 亚洲国产91精品在线观看| 99在线|亚洲一区二区| 一区二区精品在线| 欧美在线高清| 欧美sm视频| 亚洲美女91| 亚洲在线一区二区三区| 久久精品72免费观看| 免费成人av在线| 国产精品国产自产拍高清av王其| 国产精品久久久久久模特| 国产精品日韩在线一区| 国产一区二区三区成人欧美日韩在线观看 | 欧美视频福利| 国产欧美一区二区精品婷婷 | 亚洲免费高清视频| 欧美一二区视频| 亚洲第一在线综合网站| 一区二区三区精品| 日韩亚洲精品在线| 欧美在线视频a| 欧美美女福利视频| 狠狠色狠色综合曰曰| 一区二区三区高清| 老司机午夜精品视频| 亚洲视频免费在线| 毛片av中文字幕一区二区| 一区二区三区久久网| 猛男gaygay欧美视频| 国产精品视频成人| 日韩视频精品在线| 欧美14一18处毛片| 亚洲欧美日韩一区| 欧美日韩国产天堂| 狠狠色噜噜狠狠狠狠色吗综合| 欧美亚洲成人免费| 亚洲免费观看高清完整版在线观看| 久久国产88| 亚洲在线电影| 亚欧成人精品| 国产精品久久久久久久久久直播| 亚洲精品久久久久久久久久久久久| 欧美一级视频一区二区| 在线视频一区观看| 亚洲国产精品va在看黑人| 久久国产精品高清| 国产夜色精品一区二区av| 一区免费视频| 久久蜜桃资源一区二区老牛| 99天天综合性| 欧美日韩伦理在线| 91久久国产综合久久| 先锋资源久久| 久久国产黑丝| 性欧美精品高清| 国内精品久久久久久影视8| 欧美va亚洲va日韩∨a综合色| 免费不卡亚洲欧美| 欧美大片第1页| 欧美日韩免费高清一区色橹橹| 一区二区三区免费看| 亚洲综合成人在线| 亚洲精品国产视频| 亚洲欧美激情精品一区二区| 一区在线免费| 在线综合亚洲| 欲香欲色天天天综合和网| 亚洲精选大片| 国产综合网站| 亚洲另类在线视频| 激情欧美日韩| 亚洲一区二区三区精品在线| 亚洲国产欧美日韩精品| 午夜精品久久久久久久男人的天堂| 亚洲欧洲综合另类| 久久精品夜色噜噜亚洲a∨| 亚洲深夜福利视频| 欧美一区二区三区在线播放| 亚洲国产aⅴ天堂久久| 亚洲激情小视频| 国产精品www色诱视频| 久久久久国产一区二区三区| 免费欧美视频| 亚洲综合日韩在线| 久久久久www| 中日韩男男gay无套| 久久精品在线| 亚洲综合社区| 欧美大秀在线观看| 久久精品在线免费观看| 欧美日韩mp4| 你懂的一区二区| 国产精品理论片在线观看| 欧美成年人视频网站| 国产精品萝li| 亚洲欧洲精品一区二区三区 | 亚洲盗摄视频| 性欧美8khd高清极品| 亚洲乱码日产精品bd| 亚洲一区二区三区色| 亚洲国产精品高清久久久| 亚洲一区在线直播| 日韩五码在线| 麻豆成人综合网| 久久久久久亚洲综合影院红桃| 欧美日韩国产成人在线观看| 男人插女人欧美| 国产一区二区丝袜高跟鞋图片 | 久久精品欧美日韩精品| 亚洲一区视频| 欧美日产一区二区三区在线观看 | 在线日本欧美| 一本不卡影院| 国产精品久久久久久久久借妻| 亚洲女同精品视频| 国产精品日韩专区| 久热精品视频在线观看| 亚洲最快最全在线视频| 香蕉久久夜色精品国产| 久久网站免费| 欧美精品午夜视频| 久久婷婷亚洲| 国产精品亚洲一区二区三区在线| 欧美成人中文字幕在线| 国产一区二区三区在线观看免费视频| 亚洲精品视频中文字幕| 91久久在线视频| 亚洲精品孕妇| 亚洲精品字幕| 欧美理论电影在线播放| 亚洲欧洲在线看| 在线视频成人| 女人天堂亚洲aⅴ在线观看| 猛干欧美女孩| 亚洲黑丝在线| 欧美日韩国产色视频| 亚洲人成网站在线播| 99人久久精品视频最新地址| 欧美精品 日韩| 一本到12不卡视频在线dvd| 亚洲综合视频一区| 国产亚洲日本欧美韩国| 久久成人综合视频| 欧美成人一区二区三区| 亚洲韩国日本中文字幕| 欧美精彩视频一区二区三区| 日韩亚洲欧美一区| 午夜精品久久久久久久| 国产一区二区中文字幕免费看| 亚洲一区二区视频在线| 久久99在线观看| 欧美激情视频一区二区三区不卡| 日韩视频欧美视频| 国产欧美日韩在线播放| 欧美人妖另类| 久热re这里精品视频在线6| 亚洲尤物精选| 亚洲欧洲三级电影| 麻豆成人综合网| 午夜一级久久| 亚洲网友自拍| 亚洲理论在线观看| 激情久久综合| 国产精品资源在线观看| 欧美日本亚洲视频| 免费在线观看精品| 久久免费国产| 久久久国产精品一区二区中文| 亚洲影院免费观看|