{"id":15064985,"url":"https://github.com/tonivade/claudb","last_synced_at":"2025-12-27T16:08:25.562Z","repository":{"id":32084581,"uuid":"35656597","full_name":"tonivade/claudb","owner":"tonivade","description":"ClauDB is a REDIS implementation in Java","archived":false,"fork":false,"pushed_at":"2025-03-29T09:13:06.000Z","size":3445,"stargazers_count":175,"open_issues_count":10,"forks_count":32,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T01:06:21.993Z","etag":null,"topics":["embedded","integration-testing","java","key-value","lua","master-slave","netty4","redis","rxjava"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tonivade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-15T06:03:07.000Z","updated_at":"2025-03-29T14:18:36.000Z","dependencies_parsed_at":"2024-03-01T07:23:17.062Z","dependency_job_id":"81d78f77-85ed-4a6e-84d3-ead34b194e54","html_url":"https://github.com/tonivade/claudb","commit_stats":{"total_commits":851,"total_committers":7,"mean_commits":"121.57142857142857","dds":0.3913043478260869,"last_synced_commit":"cb829c653de14a88081a96b3d9adf85a1f773135"},"previous_names":["tonivade/tinydb"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonivade%2Fclaudb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonivade%2Fclaudb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonivade%2Fclaudb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonivade%2Fclaudb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonivade","download_url":"https://codeload.github.com/tonivade/claudb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633236,"owners_count":21136836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","integration-testing","java","key-value","lua","master-slave","netty4","redis","rxjava"],"created_at":"2024-09-25T00:28:58.843Z","updated_at":"2025-12-27T16:08:25.487Z","avatar_url":"https://github.com/tonivade.png","language":"Java","funding_links":[],"categories":["数据库"],"sub_categories":[],"readme":"# ClauDB\n\nClauDB is a REDIS implementation in Java. At the moment is in development and only implements a small \nsubset of commands and features.  The objetive is implement a full functional one-to-one replacement \nfor REDIS (2.8 branch).\n\nYou will probably wonder why I do this, the answer is I do it Just For Fun.\n\n## Why ClauDB?\n\nInitially I called this project TinyDB, but there's another project with the same name, so, I've\ndecided to chage to ClaudDB.\n\nClau is :key: in Valencià, a language spoken in eastern Spain, and ClauDB is a key-value database.\n\n## Implemented commands\n\n\u003cdetails\u003e\n    \u003csummary\u003eServer\u003c/summary\u003e\n    \n- FLUSHDB\n- INFO\n- TIME\n- SYNC\n- SLAVEOF\n- ROLE\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eConnection\u003c/summary\u003e\n    \n- ECHO\n- PING\n- QUIT\n- SELECT\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eKey\u003c/summary\u003e\n    \n- DEL\n- EXISTS\n- KEYS\n- RENAME\n- TYPE\n- EXPIRE\n- PERSIST\n- TTL\n- PTTL\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eString\u003c/summary\u003e\n    \n- APPEND\n- DECRBY\n- DECR\n- GET\n- GETSET\n- INCRBY\n- INCR\n- MGET\n- MSET\n- MSETNX\n- SET (with NX, PX, NX and XX options)\n- SETEX\n- SETNX\n- STRLEN\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eHash\u003c/summary\u003e\n    \n- HDEL\n- HEXISTS\n- HGETALL\n- HGET\n- HKEYS\n- HLEN\n- HMGET\n- HMSET\n- HSET\n- HVALS\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eList\u003c/summary\u003e\n    \n- LPOP\n- LPUSH\n- LINDEX\n- LLEN\n- LRANGE\n- LSET\n- RPOP\n- RPUSH\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eSet\u003c/summary\u003e\n    \n- SADD\n- SCARD\n- SDIFF\n- SINTER\n- SISMEMBER\n- SMEMBERS\n- SPOP\n- SRANDMEMBER\n- SREM\n- SUNION\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eSorted Set\u003c/summary\u003e\n    \n- ZADD\n- ZCARD\n- ZRANGEBYSCORE\n- ZRANGE\n- ZREM\n- ZREVRANGE\n- ZINCRBY\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003ePub/Sub\u003c/summary\u003e\n    \n- SUBSCRIBE\n- UNSUBSCRIBE\n- PSUBSCRIBE\n- PUNSUBSCRIBE\n- PUBLISH\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eTransactions\u003c/summary\u003e\n    \n- MULTI\n- EXEC\n- DISCARD\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eScripting\u003c/summary\u003e\n    \n- EVAL\n- EVALSHA\n- SCRIPT LOAD\n- SCRIPT EXISTS\n- SCRIPT FLUSH\n\n\u003c/details\u003e\n\n## Design\n\nClauDB is implemented using Java8. Is single thread, like REDIS. It uses asynchronous IO \n(netty) and reactive programing paradigm (rxjava).\n\nRequests come from IO threads and enqueues to rxjava single thread scheduler. Then IO thread is free\nto process another request. When request is done, the response is sended to client asyncronously. Then,\nevery request is managed one by one, in a single thread, so there's no concurrency issues to care\nabout.\n\n## Features\n\nNow only implements a subset of REDIS commands, but is usable.\n\n~~ClauDB also supports persistence compatible with REDIS, RDB dumps and AOF journal. It can create\ncompatible RDB files you can load in a REDIS server.~~ Removed since 2.0 version\n\nNow ClauDB support master/slave replication, a master can have multiple slaves, but at the moment\nslaves can't have slaves.\n\nAlso implements partially the Pub/Sub subsystem.\n\n## Changes in 2.0 version\n\nThe RDB file format support has been dropped and replaced with h2 [MVStore](http://www.h2database.com/html/mvstore.html).\n\nThis allows ClauDB to have file persistence and off heap memory support.\n\nAnother important change, now ClauDB has been splited in several subprojects:\n\n  - claudb-lib: implementation of the server and commands.\n  - claudb-app: command line application to run standalone server and client.\n  - claudb-junit4: implements a Junit4 compatible @Rule to use in junit4 based tests. [Example](https://github.com/tonivade/claudb/blob/master/junit4/src/test/java/com/github/tonivade/claudb/junit4/TestJunit4Rule.java)\n  - claudb-junit5: implements a Junit5 compatible extension to use in junit5 based tests. [Example](https://github.com/tonivade/claudb/blob/master/junit5/src/test/java/com/github/tonivade/claudb/junit5/TestJunit5Extension.java)\n\n## Performance\n\nPerformance is quite good, not as good as REDIS, but it's good enough for Java.\n\nThis is ClauDB\n\n    $ redis-benchmark -t set,get -h localhost -p 7081 -n 100000 -q\n    SET: 82576.38 requests per second, p50=0.303 msec\n    GET: 93896.71 requests per second, p50=0.287 msec\n    \nAnd this is REDIS\n\n    $ redis-benchmark -t set,get -h localhost -p 6379 -n 100000 -q\n    SET: 148148.14 requests per second, p50=0.167 msec\n    GET: 147710.48 requests per second, p50=0.175 msec\n    \nIn my laptop (Intel Core i7-1065G7, with 32G of RAM, running linux)\n\n## BUILD\n\nYou need to clon the repo:\n\n    $ git clone https://github.com/tonivade/claudb.git\n\nClauDB uses Gradle as building tool, but you don't need Gradle installed, just type:\n\n    $ ./gradlew build\n\nThis scripts automatically download Gradle and then runs the tasks. \n\nOr if you have Gradle installed, just type\n\n    $ gradle build\n    \nCreate all-in-one jar\n\n    $ ./gradlew fatJar\n\n## DOCKER\n\nYou can create your own docker images for ClauDB using the provided `Dockerfile`\n\n    $ docker build -t claudb .\n\nAnd then run the image\n\n    $ docker run -p 7081:7081 claudb\n\n## USAGE\n\nYou can start a new server listening in default port 7081.\n\n    $ wget https://repo1.maven.org/maven2/com/github/tonivade/claudb-app/2.0.1/claudb-app-2.0.1-all.jar\n    $ java -jar claudb-2.0.1-all.jar\n\nor using [jgo](https://github.com/scijava/jgo) utility\n\n    $ jgo com.github.tonivade:claudb-app:2.0.1:com.github.tonivade.claudb.Server\n    \nParameters:\n\n    Option                  Description\n    ------                  -----------\n    -N                      enable keyspace notifications (experimental)\n    -O                      enable off heap memory (experimental)\n    -P [String: file name]  enable persistence (experimental) (default: ./claudb.data)\n    -V                      verbose mode\n    -h \u003cString: host\u003e       define listen host (default: localhost)\n    --help                  print help\n    -p \u003cInteger: port\u003e      define listen port (default: 7081)\n\nAlso you can use inside your project using Maven\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.tonivade\u003c/groupId\u003e\n        \u003cartifactId\u003eclaudb\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.1\u003c/version\u003e\n    \u003c/dependency\u003e\n    \nOr gradle\n\n    compile 'com.github.tonivade:claudb:2.0.1'\n\nOr embed in your source code\n\n```java\n    RespServer server = ClauDB.builder().host(\"localhost\").port(7081).build();\n    server.start(); \n```\n\n## Native Image\n\nNow is possible to generate a native image thanks to graalvm. You can generate one with this command:\n\n```shell\n$ ./gradlew clean nativeImage\n```\n\nSome features are not available like lua runtime and offheap memory.\n\n## TODO\n\n- Ziplist and Maplist encoding not implemented yet.\n- Master/Slave replication improvements. Slave with Slaves\n- Partitioning?\n- Clustering?\n- Geo Commands\n\n## Continuous Integration\n\n[![Java CI with Gradle](https://github.com/tonivade/claudb/actions/workflows/gradle.yml/badge.svg)](https://github.com/tonivade/claudb/actions/workflows/gradle.yml)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/63af79474b40420da97b36d02972f302)](https://www.codacy.com/app/tonivade/claudb?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=tonivade/claudb\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/63af79474b40420da97b36d02972f302)](https://www.codacy.com/app/tonivade/claudb?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=tonivade/claudb\u0026utm_campaign=Badge_Coverage)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.tonivade/claudb/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.tonivade/claudb)\n[![Join the chat at https://gitter.im/tonivade/claudb](https://badges.gitter.im/tonivade/claudb.svg)](https://gitter.im/tonivade/claudb?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/tonivade/claudb.svg)](https://starchart.cc/tonivade/claudb)\n\n## LICENSE\n\nClauDB is released under MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonivade%2Fclaudb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonivade%2Fclaudb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonivade%2Fclaudb/lists"}