Skip to content
xiongyee2000 edited this page Dec 7, 2021 · 2 revisions

BeanDB

Introduction

BeanDB is a small and well designed object database engine.

Application Domain

BeanDB is aimed to be used on database based applications running on "rich" devices, e.g. autonomous driving related vehicle applications, or some AIoT device side applications.

Developing Language

BeanDB is developed in C++.

Characteristics

BeanDB has following characteristics:

- small footprint
  • code lines <3000
  • size of binary file < 200K
- Object Oriented

In BeanDB, data are represented as objects (called bean), and data storage are also based on objects. Yes, this is one of the main characteristics of an object database.

- Dynamic Properties

In BeanDB, object properties are runtime dynamic. User can add/remove/modify properties of an object at run time according to specific needs. Yes, this is also one of the main characteristics of an object database.

- JSON like Object

In BeanDB, the bean object is designed to be JSON like (and is internally implemented on top of JSON), so as to make it easy to use for most JSON friendly users.

- Strong Typed Property

In BeanDB, properties are strong typed. Value type must be specified explicitly when a property is defined, for example int/real/bool/string etc. This is different from that of JSON.

- Global Property

In BeanDB, the definition of a property is global. The property with the same name always indicates the same semantics. Actually this global uniqueness of property is the guarantee of the validity of the property based search.

- Native Data Support

It is allowed in BeanDB to attach a JSON value in arbitrary structure (called Native Data) to a bean object. This mechanism makes it possible to save any data in JSON format into a BeanDB database easily.

Main Features

  • Define/Undefine a property (See examples for detail)
  • Create/Delete a bean from database (See examples for detail)
  • Load a bean object from database/Unload a bean from world (See examples for detail)
  • Add/Remove/Set property values for a bean (See examples for detail)
  • Add/Remove/Set native data for a bean (See examples for detail)
  • Save bean/Save bean property value (See examples for detail)
  • Property based search (See examples for detail)

Architecture & Design

TBD

How to Build

(Build Environment currently used: Ubuntu 7.5)

Dependencies
  • gcc (c++11)
  • cmake (>2.8)
  • jsoncpp
  • sqlite3
Build beandb libraries:
./build.sh

(build output is under dist)

Build examples:
./build_examples.sh

(Build output is under build_examples)

Build doxygen documentation (need to install doxygen):
./doxy_gen.sh

(Build output is under doc/doxygen/html)

How to use

See code examples under examples directory.

New features in future

  • JSON binary storage
  • binary property support (blob)
  • class hierarchy of objects
  • Search/Control via Console (CLI)
  • Transaction support
  • Query Language support
  • More database backend implementation
  • Multi-language interfaces
  • Backup/Restore
  • Cloud-Device synchronization
  • and more...

Contributors

Tony: xiongyee@hotmail.com

LICENSE

LGPL 2.1

**Welcome to join! ** 😄