Introduction
Because I need to save some important data in the software, I want to use an embedded database. First, to keep the software delicate, the two require high performance. When I was looking for an embedded database, I found Berkeley dB. I also saw a lot of related introductions. The evaluation was good, and some people made evaluations, there are also many success stories of using open source in Berkeley dB, such as famous projects such as Sendmail and OpenOffice. Berkeley dB is simple, small, reliable, and high-performance. What I need is SQLite, but I don't need it to be able to execute SQL, but I do not know that an SQL Execution engine will increase its size a lot.
History
The history of Berkeley dB is a long history. It has been 15 years since the first release, and sleepycat (sleepy cat? Lazy cat ?) The company provides its commercial support, directed to the current 4.4.2 version, the source code is CCodeBut it provides interfaces in multiple languages: C/C ++, Java, and TCL. Others provide C # APIs on SourceForge. Now sleepycat has been acquired by Oracle to deal with MySQL, further enriching the oralce product line.
Features
Simple, small, reliable, high-performance, small but refined. Add Berkeley dB and ourProgramCompilation is a program (embedded), which is in the same address space as the program running. There is no network communication overhead or process communication resource consumption, in addition, there is no complex SQL analysis and explanation. Using APIs for direct access is really straightforward and quick. Berkeley dB only has several hundred kb, But it supports TB of data and concurrent access from thousands of users.
Real Transaction support-its most powerful feature.
Multithreading/process processing support.
Supports hot backup.
Disadvantages
Any transaction has its own shortcomings, as does Berkeley DB:
The Berkeley dB environment is not cross-platform and does not support old systems such as Windows 98/95.
Network Sharing is not allowed.
Sensitive to interruptions.
Data Structure
Different from relational databases, Berkeley dB does not have a fully equivalent table to a relational database, but only something like DBT-it is a key/Data pair, we can regard the key as the primary key of the table, and data is the remaining n-1 column. We can define a struct and store it in data, so that each field of the struct is equivalent to a field. Berkeley dB also has cursor, which can traverse multiple records and traverse multiple records with the same key. The core data structure in Berkeley dB is dB, which represents the database, physically. DB file, we can set the page size, storage data basic data structure (balance Binary Tree, hash table, queue and record ). In addition, db_env is a complex database environment that provides advanced functions such as transactions, multithreading, logs, backup, and recovery.
Application scenarios
Berkeley dB is a dedicated product that focuses on certain application scenarios. It is suitable for storing simple data in embedded systems or some consumer software.
Related blog
Http://blog.sina.com.cn/u/1181509184
All Berkeley dB related Essays