Inspired by Redis, Rhino-Rox aims at providing an easy way to serve your in-memory data structure via network.
Yes, you should use Redis whenever possible. However, occasionally there are some infrequently used data structures that you do want to wrap them up and access from different processes or machines. Imaging you've been asked, "Hey, this data structure is great, can I access it from anywhere like Redis?". Rhino-Rox is an attempt to solve that kind of problem. Recently, the redis author started an initiative that intends to add a loadable module system to Redis. It would be very exciting to see that feature lands to Redis.
Rhino-Rox reuses a number of modules from Redis,for instance, event handling, sds, Redis protocal etc. It was not designed to provide those advanced features like Redis, i.e. clustering, sentinel, PubSub and so forth. By design, it should just serve as a single-node data structure server. That being said, you can use most of existing Redis clients to communicate with Rhino-Rox server without any extra adaption.
Clone the repo, then make, that's it for now! Rhino-Rox also depends on jemalloc, it'll download and install it automatically.
There are also a few options in the configuration file rhino-rox.ini.
$ ./rhino-rox
$ nc localhost 6000
infotype keypingecho
set key valueget key valuedel keyexists key
rset user key valuerget user keyrpget user prefixrkeys userrvalues userrgetall userrexists user
qpush task 1.0 val1qpush task 2.0 val2qpush task 0.5 val3qpeek taskqpop taskqlen taskqpopn task 100
dset animals cat "A cat is trolling a lion"dset animals dog "A naughty dog is chasing a ball"dget animals catdsearch animals "cat lion"ddel animals catdlen animals
Rhino-Rox (Rhinopithecus Roxellana), also known as golden snub-nosed monkey, is an old World monkey in the Colobinae subfamily. Like giant panda, this cute species is also an endangered one, only 8000-15000 are inhabiting mostly in Sichuan, China. (Yes, Sichuan is also the hometown of panda bears).
BSD
The codebase is organized much like Redis, just simplied a bit due to its design goals mentioned above. In a nutshell, equipped by non-blocking IO, Rhino-Rox is a single thread application along with timers excutes periodically during socket IO handling. By and large, there are two major parts: the server and the data structures:
-
Server
- loading configurations (rr_config.c)
- server initialization, query handling, and close (rr_server.c, rr_reply.c)
- event loop and network handling (rr_event.c, rr_epoll.c, rr_kqueue.c, rr_network.c)
- timer and server cron job (rr_event.c, rr_server.c)
-
Data structures
- a simple dynamic array and a heap built upon it (rr_array.c, rr_minheap.c)
- double linked list, implemented by Redis (adlist.c)
- will add more to be finally served by Rhino-Rox