All Projects → radareorg → Sdb

radareorg / Sdb

Licence: mit
Simple and fast string based key-value database with support for arrays and json

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Sdb

Tech Refrigerator
🍰 기술 냉장고입니다. 🛒 기술 면접 , 전공 시험 , 지식 함양 등 분명 도움될 거예요! 🤟
Stars: ✭ 699 (+339.62%)
Mutual labels:  hacktoberfest, data-structures, database
Vue Materialize Datatable
A fancy Materialize CSS datatable VueJS component.
Stars: ✭ 162 (+1.89%)
Mutual labels:  hacktoberfest, data-structures, database
Nutsdb
A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set.
Stars: ✭ 1,827 (+1049.06%)
Mutual labels:  data-structures, database, key-value
Zookeeper
Apache ZooKeeper
Stars: ✭ 10,061 (+6227.67%)
Mutual labels:  hacktoberfest, database, key-value
Codezilla
⚡️ codezilla ⚡️ One giant 🦖 collection of algorithms & design patterns.
Stars: ✭ 127 (-20.13%)
Mutual labels:  hacktoberfest, data-structures
Rust Etcd
An etcd client library for Rust.
Stars: ✭ 119 (-25.16%)
Mutual labels:  database, key-value
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-19.5%)
Mutual labels:  hacktoberfest, database
Olric
Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.
Stars: ✭ 2,067 (+1200%)
Mutual labels:  database, key-value
Etcd
Distributed reliable key-value store for the most critical data of a distributed system
Stars: ✭ 38,238 (+23949.06%)
Mutual labels:  database, key-value
Ardb
A redis protocol compatible nosql, it support multiple storage engines as backend like Google's LevelDB, Facebook's RocksDB, OpenLDAP's LMDB, PerconaFT, WiredTiger, ForestDB.
Stars: ✭ 1,707 (+973.58%)
Mutual labels:  database, key-value
Interviews
A list of fancy questions I've been asked during the interviews I had. Some of them I ask when interviewing people.
Stars: ✭ 140 (-11.95%)
Mutual labels:  data-structures, database
Competitive Programming
Hello Programmers 💻 , A one-stop Destination✏️✏️ for all your Competitive Programming Resources.📗📕 Refer CONTRIBUTING.md for contributions
Stars: ✭ 113 (-28.93%)
Mutual labels:  hacktoberfest, data-structures
Gkvdb
[mirror] Go语言开发的基于DRH(Deep-Re-Hash)深度哈希分区算法的高性能高可用Key-Value嵌入式事务数据库。基于纯Go语言实现,具有优异的跨平台性,良好的高可用及文件IO复用设计,高效的底层数据库文件操作性能,支持原子操作、批量操作、事务操作、多表操作、多表事务、随机遍历等特性。
Stars: ✭ 109 (-31.45%)
Mutual labels:  database, key-value
Java
All Algorithms implemented in Java
Stars: ✭ 42,893 (+26876.73%)
Mutual labels:  hacktoberfest, data-structures
Immudb
immudb - world’s fastest immutable database, built on a zero trust model
Stars: ✭ 3,743 (+2254.09%)
Mutual labels:  database, key-value
Arangodb
🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
Stars: ✭ 11,880 (+7371.7%)
Mutual labels:  database, key-value
Jupyter
Stars: ✭ 145 (-8.81%)
Mutual labels:  hacktoberfest, data-structures
Pygm
🐍 Python library implementing sorted containers with state-of-the-art query performance and compressed memory usage
Stars: ✭ 156 (-1.89%)
Mutual labels:  data-structures, database
C Plus Plus
Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
Stars: ✭ 17,151 (+10686.79%)
Mutual labels:  hacktoberfest, data-structures
Unqlite
An Embedded NoSQL, Transactional Database Engine
Stars: ✭ 1,583 (+895.6%)
Mutual labels:  database, key-value

SDB (string database)

sdb is a simple string key/value database based on djb's cdb disk storage and supports JSON and arrays introspection.

mcsdbd is a memcache server with disk storage based on sdb. It is distributed as a standalone binary and a library.

There's also the sdbtypes: a vala library that implements several data structures on top of an sdb or a memcache instance.

GHA GHA Travis Build Status

Author

pancake [email protected]

Contains

  • namespaces (multiple sdb paths)
  • atomic database sync (never corrupted)
  • bindings for vala, luvit, newlisp and nodejs
  • commandline frontend for sdb databases
  • memcache client and server with sdb backend
  • arrays support (syntax sugar)
  • json parser/getter (js0n.c)

Rips

  • disk storage based on cdb code
  • linked lists from r2 api

Compilation

For native builds just type make. Everything will be compiled twice to get the .dylib and .a and sdb in PIC and nonPIC modes.

To compile with Emscripten for Javascript:

make CC=emcc EXT_EXE=.js

To crosscompile with meson:

$ cat > cross-file.txt <<EOF
[properties]
exe_wrapper = 'wine'
and then run meson build --cross-file cross-file.txt ; ninja -C build. It should work and it should create another binary called sdb_native.
EOF
$ meson build --cross-file cross-file.txt
$ ninja -C build

Changes

I have modified cdb code a little to create smaller databases and be memory leak free in order to use it from a library.

The sdb's cdb database format is 10% smaller than the original one. This is because keylen and valuelen are encoded in 4 bytes: 1 for the key length and 3 for the value length.

In a test case, a 4.3MB cdb database takes only 3.9MB after this file format change.

Usage example

Let's create a database!

$ sdb d hello=world
$ sdb d hello
world

Using arrays (>=0.6):

$ sdb - '[]list=1,2' '[0]list' '[0]list=foo' '[]list' '[+1]list=bar'
1
foo
2

Let's play with json:

$ sdb d g='{"foo":1,"bar":{"cow":3}}'
$ sdb d g:bar.cow
3
$ sdb - user='{"id":123}' user:id=99 user:id
99

Using the commandline without any disk database:

$ sdb - foo=bar foo a=3 +a -a
bar
4
3

$ sdb -
foo=bar
foo
bar
a=3
+a
4
-a
3

Remove the database

$ rm -f d
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].