• Stars
    star
    791
  • Rank 55,239 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast and lightweight Redis Cluster Proxy for Redis 3.0

Corvus

Build Status

Corvus is a fast and lightweight redis cluster proxy for redis 3.0 with cluster mode enabled.

Why

Most redis client implementations don't support redis cluster. We have a lot of services relying on redis, which are written in Python, Java, Go, Nodejs etc. It's hard to provide redis client libraries for multiple languages without breaking compatibilities. We used twemproxy before, but it relies on sentinel for high availabity, it also requires restarting to add or remove backend redis instances, which causes service interruption. And twemproxy is single threaded, we have to deploy multiple twemproxy instances for large number of clients, which causes the sa headaches.

Therefore, we made corvus.

Features

  • Fast.
  • Lightweight.
  • Painless upgrade to official redis cluster from twemproxy.
  • Multiple threading.
  • Reuseport support.
  • Pipeline support.
  • Statsd integration.
  • Syslog integration.
  • Can direct read operations to slaves.

Performance

See details in our test results.

Requirements

  • Linux >= 3.9
  • Redis <= 3.0.7 (For version up to/including 0.2.3)

Build

If use the releases downloaded from releases page, just make:

$ make

With debug mode enabled:

make debug

If build from latest source:

git clone https://github.com/eleme/corvus.git
cd corvus
git submodule update --init
make deps # need autoconf
make

Binary can be found at ./src/corvus.

Configuration

Example configuration file is at corvus.conf.

Usage

$ ./src/corvus path/to/corvus.conf

Commands

  • All single-key commands (like SET, GET, INCR..) are supported.
  • Batch commands are split into multiple single-key commands.
  • Commands performing complex multi-key operations like unions or intersections are available as well as long as the keys all belong to the same node.

Modified commands

  • MGET: split to multiple GET.
  • MSET: split to multiple SET.
  • DEL: split to multiple single key DEL.
  • EXISTS: split to multiple single key EXISTS.
  • PING: ignored and won't be forwarded.
  • INFO, TIME: won't be forwarded to backend redis, information collected in proxy will be returned.
  • SLOWLOG: return the slowlogs saved by corvus itself. Note that unlike redis, in the slowlog entry there's an additional remote latency field before the total latency field. The slowlog will also log the slowest sub command for multiple-key commands: MGET, MSET, DEL, EXISTS. The total latency of sub cmd entry will just be the same as its parent cmd.
  • AUTH: do authentication in proxy.
  • CONFIG: support get, set, and rewrite sub-command to retrieve and manipulate corvus config.
  • SELECT: ignored if index is 0, won't be forwarded.

Restricted commands

  • EVAL: at least one key should be given. If there are multiple keys, all of them should belong to the same node.

The following commands require all argument keys to belong to the same redis node:

  • SORT.
  • RPOP, LPUSH.
  • SDIFF, SDIFFSTORE, SINTER, SINTERSTORE, SMOVE, SUNION, SUNIONSTORE.
  • ZINTERSTORE, ZUNIONSTORE.
  • PFCOUNTE, PFMERGE.

Unsupported commands

The following commands are not available, such as KEYS, we can't search keys across all backend redis instances.

  • KEYS, MIGRATE, MOVE, OBJECT, RANDOMKEY, RENAME, RENAMENX, SCAN, WAIT.
  • BITOP, MSETNX
  • BLPOP, BRPOP, BRPOPLPUSH.
  • PSUBSCRIBE, PUBLISH, PUBSUB, PUNSUBSCRIBE, SUBSCRIBE, UNSUBSCRIBE.
  • EVALSHA, SCRIPT.
  • DISCARD, EXEC, MULTI, UNWATCH, WATCH.
  • CLUSTER.
  • ECHO, QUIT.
  • BGREWRITEAOF, BGSAVE, CLIENT, COMMAND, CONFIG, DBSIZE, DEBUG, FLUSHALL, FLUSHDB, LASTSAVE, MONITOR, ROLE, SAVE, SHUTDOWN, SLAVEOF, SYNC.

License

MIT. Copyright (c) 2016 Eleme Inc.

See LICENSE for details.

More Repositories

1

UETool

Show/edit any view's attributions on the screen.
Java
3,256
star
2

lancet

A lightweight and fast AOP framework for Android App and SDK developers
Java
2,083
star
3

morjs

基于小程序 DSL(微信、支付宝)的,可扩展的多端研发框架,支持一键将微信或支付宝小程序转换为微信、支付宝、百度、字节、QQ、快手、淘宝、钉钉等小程序 或 Web 应用。
TypeScript
1,400
star
4

Amigo

A hotfix library for Android platform, and not just this...
Java
1,365
star
5

Stinger

Stinger is a high-efficiency library with great compatibility, for aop in Objective-C, using libffi instead of Objective-C message forwarding. It is 20+ times faster than the Aspects, from message-sending to Aspect-oriented code ends.
Objective-C
988
star
6

Mess

a gradle plugin for minifying activities, services, receivers, providers and custom view
Groovy
682
star
7

Trojan

Trojan is an efficient mobile terminal lightweight log SDK
Java
390
star
8

dna

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.
Dart
365
star
9

bigkeeper

Efficiency improvement for iOS&Android modular development.
Ruby
212
star
10

Intimate

Intimate 提供了友好的 API 让 java 反射的使用更加简单平滑。 其最核心的价值在于 Intimate 将在编译期对 apk 内部代码的调用进行反射优化,完全免除反射的效率问题,使得反射调用就像普通调用一样快捷且无任何代价。
Java
202
star
11

duang

自动 CMS 生成工具
JavaScript
199
star
12

tedis

基于TiKV的兼容Redis协议的强一致性NoSQL数据库
Go
181
star
13

eleme.github.io

Eleme Developers Homepage
CSS
116
star
14

Sparrow

Vue
79
star
15

mobilists

mobile team blog
JavaScript
57
star
16

thrift-parser

To parse thrift file to a AST.
JavaScript
53
star
17

meepo

Event sourcing and broadcasting for database.
Python
52
star
18

ruskit

Redis cluster administration toolkit
Python
34
star
19

doctor

Metric based in-memory circuit breaker for python
Python
23
star
20

react-context-global-store

A simple global store based on React context
TypeScript
22
star
21

NVMImageMaker

API for chaining image drawing codes in Objc.
Objective-C
19
star
22

node-thrift-protocol

An implementation of thrift-protocol with node.
JavaScript
18
star
23

easyxml

php xml lib
PHP
17
star
24

SparrowSDK-iOS

Objective-C
16
star
25

NVMAspects

C
15
star
26

thrift-php

Mirror of apache thrift php lib
PHP
10
star
27

thrift-client

A nodejs thrift client
JavaScript
8
star
28

python-jianfan-mirror

mirror of https://code.google.com/p/python-jianfan/
Python
4
star
29

SparrowSDK-Android

4
star
30

thrift-tracker

Go
1
star
31

finite

F-init-E
JavaScript
1
star
32

python-geohash-mirror

mirror of https://code.google.com/p/python-geohash/
Python
1
star