All Projects → tonivade → Claudb

tonivade / Claudb

Licence: mit
ClauDB is a REDIS implementation in Java

Programming Languages

java
68154 projects - #9 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to Claudb

Endb
Key-value storage for multiple databases. Supports MongoDB, MySQL, Postgres, Redis, and SQLite.
Stars: ✭ 208 (+225%)
Mutual labels:  redis, key-value
Bitnami Docker Redis
Bitnami Redis Docker Image
Stars: ✭ 317 (+395.31%)
Mutual labels:  redis, key-value
rosedb
🚀 A high performance NoSQL database based on bitcask, supports string, list, hash, set, and sorted set.
Stars: ✭ 2,957 (+4520.31%)
Mutual labels:  embedded, 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 (+2567.19%)
Mutual labels:  redis, key-value
Gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Stars: ✭ 398 (+521.88%)
Mutual labels:  redis, integration-testing
Camellia
camellia framework by netease-im. provider: 1) redis-client; 2) redis-proxy(redis-sentinel/redis-cluster); 3) hbase-client; 4) others
Stars: ✭ 146 (+128.13%)
Mutual labels:  redis, netty4
Gokv
Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)
Stars: ✭ 314 (+390.63%)
Mutual labels:  redis, key-value
Slowpoke
Low-level key/value store in pure Go.
Stars: ✭ 98 (+53.13%)
Mutual labels:  key-value, embedded
Flashdb
An ultra-lightweight database that supports key-value and time series data | 一款支持 KV 数据和时序数据的超轻量级数据库
Stars: ✭ 378 (+490.63%)
Mutual labels:  key-value, embedded
Workflow
C++ Parallel Computing and Asynchronous Networking Engine
Stars: ✭ 6,680 (+10337.5%)
Mutual labels:  redis, embedded
Zanredisdb
Yet another distributed kvstore support redis data and index. moved to: https://github.com/youzan/ZanRedisDB
Stars: ✭ 64 (+0%)
Mutual labels:  redis, key-value
Elasticell
Elastic Key-Value Storage With Strong Consistency and Reliability
Stars: ✭ 453 (+607.81%)
Mutual labels:  redis, key-value
Cubdb
Elixir embedded key/value database
Stars: ✭ 235 (+267.19%)
Mutual labels:  key-value, embedded
Ansible Role Redis
Ansible Role - Redis
Stars: ✭ 176 (+175%)
Mutual labels:  redis, key-value
Unqlite
An Embedded NoSQL, Transactional Database Engine
Stars: ✭ 1,583 (+2373.44%)
Mutual labels:  key-value, embedded
Fineract-CN-mobile
DEPRECATED project - Check the Apache fineract-cn-mobile project instead
Stars: ✭ 17 (-73.44%)
Mutual labels:  rxjava, integration-testing
Ejdb
🏂 EJDB 2.0 — Embeddable JSON Database engine C library. Simple XPath like query language (JQL). Websockets / Android / iOS / React Native / Flutter / Java / Dart / Node.js bindings. Docker image.
Stars: ✭ 1,187 (+1754.69%)
Mutual labels:  key-value, embedded
Easyflash
Lightweight IoT device information storage solution: KV/IAP/LOG. | 轻量级物联网设备信息存储方案:参数存储、在线升级及日志存储 ,全新一代版本请移步至 https://github.com/armink/FlashDB
Stars: ✭ 1,236 (+1831.25%)
Mutual labels:  key-value, embedded
Dynomite
A generic dynamo implementation for different k-v storage engines
Stars: ✭ 3,830 (+5884.38%)
Mutual labels:  redis, key-value
Vedis
An Embedded Implementation of Redis
Stars: ✭ 436 (+581.25%)
Mutual labels:  redis, embedded

ClauDB

ClauDB is a REDIS implementation in Java. At the moment is in development and only implements a small subset of commands and features. The objetive is implement a full functional one-to-one replacement for REDIS (2.8 branch).

You will probably wonder why I do this, the answer is I do it Just For Fun.

Why ClauDB?

Initially I called this project TinyDB, but there's another project with the same name, so, I've decided to chage to ClaudDB.

Clau is 🔑 in Valencià, a language spoken in eastern Spain, and ClauDB is a key-value database.

Implemented commands

Server
  • FLUSHDB
  • INFO
  • TIME
  • SYNC
  • SLAVEOF
  • ROLE
Connection
  • ECHO
  • PING
  • QUIT
  • SELECT
Key
  • DEL
  • EXISTS
  • KEYS
  • RENAME
  • TYPE
  • EXPIRE
  • PERSIST
  • TTL
  • PTTL
String
  • APPEND
  • DECRBY
  • DECR
  • GET
  • GETSET
  • INCRBY
  • INCR
  • MGET
  • MSET
  • MSETNX
  • SET (with NX, PX, NX and XX options)
  • SETEX
  • SETNX
  • STRLEN
Hash
  • HDEL
  • HEXISTS
  • HGETALL
  • HGET
  • HKEYS
  • HLEN
  • HMGET
  • HMSET
  • HSET
  • HVALS
List
  • LPOP
  • LPUSH
  • LINDEX
  • LLEN
  • LRANGE
  • LSET
  • RPOP
  • RPUSH
Set
  • SADD
  • SCARD
  • SDIFF
  • SINTER
  • SISMEMBER
  • SMEMBERS
  • SPOP
  • SRANDMEMBER
  • SREM
  • SUNION
Sorted Set
  • ZADD
  • ZCARD
  • ZRANGEBYSCORE
  • ZRANGE
  • ZREM
  • ZREVRANGE
  • ZINCRBY
Pub/Sub
  • SUBSCRIBE
  • UNSUBSCRIBE
  • PSUBSCRIBE
  • PUNSUBSCRIBE
  • PUBLISH
Transactions
  • MULTI
  • EXEC
  • DISCARD
Scripting
  • EVAL
  • EVALSHA
  • SCRIPT LOAD
  • SCRIPT EXISTS
  • SCRIPT FLUSH

Design

ClauDB is implemented using Java8. Is single thread, like REDIS. It uses asynchronous IO (netty) and reactive programing paradigm (rxjava).

Requests come from IO threads and enqueues to rxjava single thread scheduler. Then IO thread is free to process another request. When request is done, the response is sended to client asyncronously. Then, every request is managed one by one, in a single thread, so there's no concurrency issues to care about.

Features

Now only implements a subset of REDIS commands, but is usable.

ClauDB also supports persistence compatible with REDIS, RDB dumps and AOF journal. It can create compatible RDB files you can load in a REDIS server.

Now ClauDB support master/slave replication, a master can have multiple slaves, but at the moment slaves can't have slaves.

Also implements partially the Pub/Sub subsystem.

Performance

Performance is quite good, not as good as REDIS, but it's good enough for Java.

This is ClauDB

$ redis-benchmark -t set,get -h localhost -p 7081 -n 100000 -q
SET: 47664.44 requests per second
GET: 50226.02 requests per second

And this is REDIS

$ redis-benchmark -t set,get -h localhost -p 6379 -n 100000 -q
SET: 97656.24 requests per second
GET: 98716.68 requests per second

In my laptop (intel core i5, with 4G of RAM)

In the latest version, ClauDB includes an option to use an off heap memory cache. See usage section

BUILD

You need to clon the repo:

$ git clone https://github.com/tonivade/claudb.git

ClauDB uses Gradle as building tool, but you don't need Gradle installed, just type:

$ ./gradlew build

This scripts automatically download Gradle and then runs the tasks.

Or if you have Gradle installed, just type

$ gradle build

Create all-in-one jar

$ gradle fatJar

DOCKER

You can create your own docker images for ClauDB using the provided Dockerfile

$ docker build -t claudb .

And then run the image

$ docker run -p 7081:7081 claudb

USAGE

You can start a new server listening in default port 7081.

$ wget http://repo1.maven.org/maven2/com/github/tonivade/claudb/1.7.1/claudb-1.7.1-all.jar
$ java -jar claudb-1.7.1-all.jar

or using jrun utility

$ jrun com.github.tonivade:claudb:com.github.tonivade.claudb.Server

Parameters:

Option        Description
------        -----------
--help        print help
-V            enable verbose log
-P            enable persistence (experimental)
-O            enable off heap memory (experimental)
-N            enable keyspace notifications (experimental)
-h <String>   host (default: localhost)
-p <Integer>  port (default: 7081) 

Also you can use inside your project using Maven

<dependency>
    <groupId>com.github.tonivade</groupId>
    <artifactId>claudb</artifactId>
    <version>1.7.1</version>
</dependency>

Or gradle

compile 'com.github.tonivade:claudb:1.7.1'

Or embed in your source code

    RespServer server = ClauDB.builder().host("localhost").port(7081).build();
    server.start(); 

Native Image

Now is possible to generate a native image thanks to graalvm. You can generate one with this command:

$ ./gradlew clean nativeImage

Some features are not available like lua runtime and offheap memory.

TODO

  • Ziplist and Maplist encoding not implemented yet.
  • Master/Slave replication improvements. Slave with Slaves
  • Partitioning?
  • Clustering?
  • Geo Commands

Continuous Integration

Build Status Codacy Badge Codacy Badge Maven Central Join the chat at https://gitter.im/tonivade/claudb

LICENSE

ClauDB is released under MIT License

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].