Giter VIP home page Giter VIP logo

redix's Introduction

Redix

redix is a key-value datastore with pluggable storage engines and redis protocol as interface, documentation & learn more

Contributions

You're welcome!

redix's People

Contributors

alash3al avatar bakaoh avatar epmills avatar feifeiiiiiiiiiii avatar heyvito avatar moaalaa avatar philippgille avatar zuckonit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redix's Issues

Compaction?

It is documented in BadgerDB user code should periodically call methods for database compaction. Otherwise it will grow indefinitely. And I don't see your code calls those methods.

feature: WEBHOOK set

As per #42 (comment)
conversation about recreating features from v1
this webhook command is still needed, with ability to set headers for auth if possible

expire abc 30

expire abc 30
unknown commands [expire]

Can the redis instructions be fully compatible?

feature request: HELLO command and discoverability

I know that you have stated it is not the intention of redix to replicate all of redis' commands however when testing it with various apps, in the current state I'm coming up against lots of errors about commands not available.

sometimes it is even a case of the app only needing basic key/value features but I am not able to use Redix because HELLO was not available.

Unknown commands KEYS & SCAN

Thank you for the great project!

I am struggling with KEYS & SCAN commands using latest Docker Image. Please take a look at logs, other commands (i.e. EXISTS) works fine:

127.0.0.1:6380> KEYS *
(error) unknown commands [keys]
127.0.0.1:6380> SCAN
(error) unknown commands [scan]
127.0.0.1:6380> EXISTS
(error) EXISTS command must have at least 1 argument: EXISTS <key>

Possible config file

Hi Mohammed Al Ashaal,

I wanted to thank you for writing this awesome layer over Badger KV store! Is it possible to have an optional config file? I would like to create .deb and .rpm packages for this great tool so people can easily install and upgrade it.

Thanks again for building this!

Ha

How can I standup 2 of these and have them stay in sync ?

Wondering if redcon would help ?

availability of v1 branch?

Hi I am actually still keen on using version 1 of this repo which had some very useful features, but it seems that branch is no longer available?
Is it possible to keep that version available somewhere else?
I noted that docker pull alash3al/redix does pull the old version and so docker pull ghcr.io/alash3al/redix is needed for v5

command line params change

  1. can't find the version cmd
    2.-engine default leveldb, at version 1.8 ,the string is level or badger
    image

3.口
image

  1. in php7.1.27 [get] cmd error. the "+" before returning the data
    image

Missing TTL command

I have read that all redis commands are not implemented but i really miss the TTL one.
(Great job, thanks).

what's the params of lrange

when i run command bellow in termnal :
lrange f10.data.4:600030 0 0
it return "(error) invalid offset specified"

is there any example or document for this command.

Too many open files

I use "predis/predis": "^1.1" with PHP and redix as an IP rate limiter.
Today my server sent ERROR 500, but redix was still alive. So i looked at the web server error log. Here is what I got :

www[5]: PHP Fatal error:
Uncaught Predis\Response\ServerException: db error: 
open redix-data/level/0/CURRENT: 
too many open files in /flex/storage/xxx/php/vendor/predis/predis/src/Client.php:370
#012
Stack trace:
#012#0
/flex/storage/xxx/php/vendor/predis/predis/src/Client.php(335): 
Predis\Client->onErrorResponse(Object(Predis\Command\KeyTimeToLive), 
Object(Predis\Response\Error))
#012#1
/flex/storage/xxx/php/vendor/predis/predis/src/Client.php(314):
Predis\Client->executeCommand(Object(Predis\Command\KeyTimeToLive))
#012#2
/flex/storage/xxx/php/myapp/class.ratelimit.redix.php(72): 
Predis\Client->__call('ttl', Array)
#012#3
/flex/storage/xxx/php/myapp/script.php(61):
RateLimit->getSleepTime($ipaddr)
#012#4
{main}
#012
thrown in /flex/storage/xxx/php/vendor/predis/predis/src/Client.php on line 370

To solve the issue, I stopped redix, then I did rm -rf redix-data and started it again.
I'm not sure about what was wrong here. If it helps.

Getting this error when trying to do go get, how do I resolve this? Thx in advance

go get github.com/alash3al/redix

github.com/google/flatbuffers/go

/go/src/github.com/google/flatbuffers/go/builder.go:14:14: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:15:12: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:16:14: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:17:12: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:21:27: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:114:36: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:203:31: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:234:26: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:239:28: undefined: UOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:275:39: undefined: SOffsetT
/go/src/github.com/google/flatbuffers/go/builder.go:275:39: too many errors

Possible to add INFO command?

Hi, lot of thanks about your work!
I try to use redix with NodeJS app and using popular client module, node_redis. But his architecture needed to use INFO command when obtain client connection. And we cant used it with Redix:

Redix error!
{ ReplyError: Ready check failed: unknown commands [info]
at parseError (/opt/tendermint/app/node_modules/redis-parser/lib/parser.js:193:12)
at parseType (/opt/tendermint/app/node_modules/redis-parser/lib/parser.js:303:14) command: 'INFO' }

Can you add this command with base support of redis-compartability?

No permissions to pull

docker pull ghcr.io/alash3al/redix                                                                                               ✘  15:19:47
Using default tag: latest
Error response from daemon: unauthorized

maybe make it publicly readable?

Docker image not building

Hi there!

It looks like the Docker build is not working

I tried adding gcc, musl-dev and linux-headers to make the compilation work without luck.

Sending build context to Docker daemon  2.048kB
Step 1/6 : FROM golang:alpine
 ---> 3289bf11c284
Step 2/6 : RUN apk update && apk add git gcc musl-dev linux-headers
 ---> Running in 33a80f6ba5fe
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
v3.12.0-138-g44b5946805 [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
v3.12.0-139-gd0df61068e [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
OK: 12748 distinct packages available
(1/19) Upgrading musl (1.1.24-r8 -> 1.1.24-r9)
(2/19) Installing libgcc (9.3.0-r2)
(3/19) Installing libstdc++ (9.3.0-r2)
(4/19) Installing binutils (2.34-r1)
(5/19) Installing gmp (6.2.0-r0)
(6/19) Installing isl (0.18-r0)
(7/19) Installing libgomp (9.3.0-r2)
(8/19) Installing libatomic (9.3.0-r2)
(9/19) Installing libgphobos (9.3.0-r2)
(10/19) Installing mpfr4 (4.0.2-r4)
(11/19) Installing mpc1 (1.1.0-r1)
(12/19) Installing gcc (9.3.0-r2)
(13/19) Installing nghttp2-libs (1.41.0-r0)
(14/19) Installing libcurl (7.69.1-r0)
(15/19) Installing expat (2.2.9-r1)
(16/19) Installing pcre2 (10.35-r0)
(17/19) Installing git (2.26.2-r0)
(18/19) Installing linux-headers (5.4.5-r1)
(19/19) Installing musl-dev (1.1.24-r9)
Executing busybox-1.31.1-r16.trigger
OK: 163 MiB in 33 packages
Removing intermediate container 33a80f6ba5fe
 ---> 6f76eb594f3d
Step 3/6 : RUN go get github.com/alash3al/redix
 ---> Running in 7d87ffcfc82f
# github.com/alash3al/redix/kvstore/badgerdb
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:29:6: opts.Dir undefined (type func(string) badger.Options has no field or method Dir)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:30:6: opts.ValueDir undefined (type func(string) badger.Options has no field or method ValueDir)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:31:6: opts.Truncate undefined (type func(string) badger.Options has no field or method Truncate)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:32:6: opts.SyncWrites undefined (type func(string) badger.Options has no field or method SyncWrites)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:33:6: opts.TableLoadingMode undefined (type func(string) badger.Options has no field or method TableLoadingMode)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:34:6: opts.ValueLogLoadingMode undefined (type func(string) badger.Options has no field or method ValueLogLoadingMode)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:35:6: opts.NumMemtables undefined (type func(string) badger.Options has no field or method NumMemtables)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:36:6: opts.MaxTableSize undefined (type func(string) badger.Options has no field or method MaxTableSize)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:37:6: opts.NumLevelZeroTables undefined (type func(string) badger.Options has no field or method NumLevelZeroTables)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:38:6: opts.ValueThreshold undefined (type func(string) badger.Options has no field or method ValueThreshold)
src/github.com/alash3al/redix/kvstore/badgerdb/badgerdb.go:38:6: too many errors

No tests

After reviewing the code, I wasn't able to find any unit or integration tests. Are there plans to add them? It's a compelling project, though personally it's hard to see it as production ready without tests.

feature request: info and scan command for redis-tui client

when trying to connect to redix with the redis-tui client it shows there are missing commands info and scan
Err unknown command info
Err unknown command scan

this feature request is low-priority as the normal redis cli and keydb-cli binaries do work.

bug: long lasting connections terminate with sql error codes

during regular set/get:
panic: FATAL: terminating connection due to idle-session timeout (SQLSTATE 57P05)
panic: FATAL: Terminated long-running connection (SQLSTATE 57000)

during pub/sub:
(error) ERR database::notification::err FATAL: terminating connection due to idle-session timeout (SQLSTATE 57P05)

above sql error codes are received when redix is left idle for about 5-10 minutes and then a new command issued.
I think the default expected behaviour would be that it would naturally maintain the connection unless there was a config setting which you could determine how long to wait in idle before disconnecting.

tested with the stand-alone binary, not within a docker container.

FLUSHDB

Redix is awesome! Thanks!

Would it be possible to implement FLUSHDB / FLUSHALL to delete everything in selected db / all dbs?

Thanks!

`go build` raise errors

When I run go build in the project, it raises errors:

# github.com/alash3al/redix/kvstore/bolt
kvstore/bolt/bolt.go:13:2: imported and not used: "go.etcd.io/bbolt" as bolt
kvstore/bolt/bolt.go:18:17: undefined: bbolt
# github.com/alash3al/redix
./commands_utils.go:23:10: assignment mismatch: 2 variables but 1 values
./init.go:27:3: undefined: "github.com/dgraph-io/badger".SetLogger

So looks like we have 3 issues here:

  1. go.etcd.io/bbolt imported as bolt(defined in the package), but never used. Considering kvstore/bolt/bolt.go package is also named bolt, we rename it to 'bbolt'
  2. satori/go.uuid v1.2.0 uuid.NewV4() returns only one value
  3. dgraph-io/badger v1.5.4 does not contains the method SetLogger, remove it.

benchmark

redis-benchmark -n 1000000 -t set,get -P 16 -q

Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz 2 Core
4G RAM
SSDB Disk

redis-5.0.3
SET: 548245.62 requests per second
GET: 671140.94 requests per second

redix V1.7
SET: 6992.27 requests per second
GET: 188323.92 requests per second

redix V1.8 (use leveldb -engine=level)
SET: 166334.00 requests per second
GET: 280190.53 requests per second

ssdb 1.9.7
SET: 34694.52 requests per second
GET: 35812.77 requests per second

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.