Licence
|
Versions 2.0 and higher of Berkeley DB are available under a dual license. Versions earlier than 2.0 are available under a BSD-like license that has an unusual additional clause similar to the GNU GPL version 2's Section 3.【From Wiki】
Dual License
The Berkeley DB products are available under a dual license model, which offers
great advantages for customers. An open source license permits customers to use
Berkeley DB at no charge under the condition that if a customer uses Berkeley DB
in an application they distribute to a third party, the complete source code for the
application must be available. A commercial software license is also available and
permits the customer to distribute their application without releasing their source
code.【From OTN】
|
Anyone
is free to copy, modify, publish, use, compile, sell, or distribute the
original SQLite code, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.【From sqlite.org】
|
API
|
Berkeley DB為許多編程語言提供了實(shí)用的API接口,包括C、C++、Java、:Perl、Tcl、Python和PHP等。適用平臺UNIX/POSIX systems、win32以及嵌入式操作系統(tǒng)WinCE、VxWorks等。
|
SQLite本身提供C和Tcl的接口,世界各地的程序員還提供了各種語言的SQLite的接口封裝, 如Python、C++、Java、.Net等幾乎所有流行的語言基本都有。sQLite提供一個(gè)抽象的操作系統(tǒng)接口層,來保證其在POSIX 與 Win32系統(tǒng)之間的兼容性。
|
數(shù)據(jù)存儲
|
Berkeley DB對任何存入的數(shù)據(jù)都是按原樣直接存儲到數(shù)據(jù)文件中,無論是二進(jìn)制數(shù)據(jù)還是A S C I I或Unicode等編碼。Berkeley DB提供了四種存儲數(shù)據(jù)的模式:Btree、Hash、Queue和Recno。
|
SQLite只提供Btree存儲數(shù)據(jù)的模式。對二進(jìn)制數(shù)據(jù),SQLite不能直接保存,但可以先將二進(jìn)制的數(shù)據(jù)轉(zhuǎn)換成ASCII編碼,然后再保存。
|
優(yōu)勢
|
首先,由于其應(yīng)用程序和數(shù)據(jù)庫管理系統(tǒng)運(yùn)行在相同的進(jìn)程空間當(dāng)中,進(jìn)行數(shù)據(jù)操作時(shí)可以避免繁瑣的進(jìn)程間通信,因此耗費(fèi)在通信上的開銷自然也就降低到了極低程度。其次,Berkeley DB使用簡單的函數(shù)調(diào)用接口來完成所有的數(shù)據(jù)庫操作,而不是在數(shù)據(jù)庫系統(tǒng)中經(jīng)常用到的SQL語言,避免了對結(jié)構(gòu)化查詢語言進(jìn)行解析和處理所需的開銷。
|
SQLite有以下特性:支持ACID事務(wù);零配置;儲存在單一磁盤文件中的一個(gè)完整的數(shù)據(jù)庫;數(shù)據(jù)庫文件可以在不同字節(jié)順序的機(jī)器間自由共享;比目前流行的大多數(shù)數(shù)據(jù)庫對數(shù)據(jù)的操作要快;提供了對事務(wù)功能和并發(fā)處理的支持;獨(dú)立,沒有額外依賴。
|