Berkeley dB -- Introduction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.