fastdb實時記憶體資料庫

簡介

fastdb是高效的記憶體資料庫系統,具備實時能力及便利的C++接口。FastDB不支持client-server架構因而所有使用FastDB的應用程式必須運行在同一主機上。FastDB針對應用程式通過控制讀訪問模式作了最佳化。通過降低數據傳輸的開銷和非常有效的鎖機制提供了高速的查詢。對每一個使用資料庫的套用資料庫檔案被影射到虛擬記憶體空間中。因此查詢在套用的上下文中執行而不需要切換上下文以及數據傳輸。fastdb中並發訪問資料庫的同步機制通過原子指令實現,幾乎不增加查詢的開銷。fastdb假定整個資料庫存在於RAM中,並且依據這個假定最佳化了查詢算法和接口。此外,fastdb沒有資料庫緩衝管理開銷,不需要在資料庫檔案和緩衝池之間傳輸數據。這就是fastdb運行速度明顯快於把數據放在緩衝池中的傳統資料庫的原因。
fastdb支持事務、線上備份以及系統崩潰後的自動恢復。事務提交協定依據一個影子根頁面算法來自動更新資料庫。恢復可以執行得非常快,為臨界套用提供了高可用性。此外,取消事務日誌改進了整個系統的性能,並且使得可以更有效的利用系統資源。
fastdb是一個面向套用的資料庫,資料庫表通過應用程式的類信息來構造。fastdb支持自動的模式評估,使你可以只需要在一個地方更改-你的應用程式的類。fastdb提供一個靈活方便的接口來從資料庫中獲取數據。使用一個類SQL的查詢語言進行指定的查詢。通過一些後關係特性如非原子欄位,嵌套數組,用戶定義類型和方法,對象間直接引用簡化了資料庫應用程式的設計並使之更有效率。
儘管fastdb的最佳化是立足於假定整個資料庫配置在計算機的物理記憶體中,但是也有可能出現使用的資料庫的大小超過了系統物理記憶體的大小的情況,在這種情況下標準的作業系統交換機制就會工作。但是整個fastdb的搜尋算法和結構是建立在假定所有的數據都存在於記憶體中的,因此數據換出的效率不會很高。
官方說明
http://www.fastdb.org/fastdb.html

License

Apache Software License

源碼下載

1.請參考官方說明
2.sourceforge資源:http://SourceForge.net/projects/fastdb

README from fastdb-3.49

FastDB is embedded main memory database.
It is intended to be used in your C/C++ application to provide
fast access to persistent data.
As far as FastDB is embedded database, there is need to start some server which
will handle client's requests. FastDB is just an library which is linked in client
application and provide access to the persistent objects.
To build FastDB library you will need use the proper makefile.
At Linux and most of other popular Unixes with GCC it is enough to
do "make". Alternatively you can look for specialized versions of makefile
included in distributive (like makefile.sun), write you own makefile based
on standard FastDB makefile or customize some existed makefile.
At Windows with Microsoft Visual C++ you can just execute "make.bat" command.
If error message is printed that "NMake" or "cl" command is not recognized, then
MS Visual Studio environment variables are not properly set.
There are two ways to solve the problem:
1. Run from "Microsoft Visual Studio" menu in start panel, choose "Microsoft Visual Studio Tools",
and in it - "Microsoft Visual Studio Command Prompt". The in this window change directory to FastDB home
and do "make.bat"
2. In "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin" directory there is vcvars32.bat file
(this is the path for VS 2003, but Visual C++ 6.0 has the similar file). Run it to setup environment in current
window.
You can also use Microsoft Visual Studio project file (fastdb.sln or fastdb.dsw) and open it with Visual Studio.
In config.h you will find various options for choosing yet or another configuration of FastDB.
The preferable way of changing configuration is to edit this file (instead of specifying correspondent
macros in compiler command line, because in last case there is a risk that you forget to specify somewhere this
option which cause inconsistency between different modules of your applications and/or FastDB library).
You can use SubSQL utility to inspect content of the database as well as for administration of database.
SubSQL can be started concurrently with you application. But please notice, that FastDB uses
single-writer-multiple-readers database level locking, so if you have performed some modification in SubSQL
and did perform commit after it, then application may be blocked until you release (commit or abort) transaction
in SubSQL.
FastDB distribution also includes a lot of examples and tests located in examples directory.
Them are also build by make. These tests are used for three different purposes:
1. Illustrate FastDB programming approach.
2. Regression tests
3. Performance measurement
More information about FastDB can be found in FastDB.htm file which is located in this directory.

相關詞條

熱門詞條

聯絡我們