a callback on a PUBLISH event (notification systems, alert solutions) Warning: Data not stored persistently (use lists with BLPOP) Canali e chat Monday, September 30, 13
The configuration is a redis list (I personally prefer a set) Active checks on the client (I prefer to use active check BY the client with Redis TTL) Hot plug/unplug backends Fast, really fast Websockets support (thanks to node-http-proxy) Monday, September 30, 13
file on S3 Version 2.6.13 (latest stable) Auto minor version upgrades Multiple nodes Zero configuration, zero maintenance, just pay. Monday, September 30, 13
will support slave acknowledgement You can have slaves of slave (but just one master) Replication is not blocking (it uses another thread) Useful for Scalability or Redundancy Use your slave to save/backup your data Use read only slaves Use auth Redis 2.8 feature: Allow writes only with N attached replicas (relaxed CAP Theorem) • min-slaves-to-write <number of slaves> • min-slaves-max-lag <number of seconds> Monday, September 30, 13
Messaging/Chat company Two main issues: * Replication of many slaves * Misconfigured servers Redis 2.6 needs a full resync between master and slave after a connection issue. Redis 2.8 has partial resync It uses additional memory every attached slave (I know you were using EC2, slow disks, dude!) They used config-set without rewriting the config file Redis 2.8 has CONFIG REWRITE command Monday, September 30, 13
memory) * multiple cores (redis is mostly single threaded) * Larger networking throughput (more TCP connections) Range Partitioning (the simple and wrong way) users from ID 0 to ID 10000 will go into instance R0 users form ID 10001 to ID 20000 will go into instance R1 ... Problems: * a table mapping is needed (where is what) * user:1, user:2 (id needed in the key) Monday, September 30, 13
for id in the key i.e. hash(foobar) = 43591045039 * Use the modulo operator to choose one of 4 backends, instance = 43591045039 % 4 Monday, September 30, 13
requests to a proxy that is able to speak the Redis protocol, no development effort Twemproxy (Redis or Memcached) from Twitter: * pipe, * sharding, * backlog * multiple hash algorithms https://github.com/twitter/twemproxy Query routing: * Redis Cluster sends your query to a random instance, the instance will forward your query to the right node. Monday, September 30, 13
Multiple key insertion not directly supported (sets in different keys) * Transactions involving multiple keys do not work * The partitioning granuliary is the key, do not use big sets for it, they will be not splitted. * Complex backup restore Summary * Redis for cache: scaling up and down using consistent hashing. * Redis to store data: the map between keys and nodes fixed is needed, balance of keys is done by Redis Cluster Monday, September 30, 13
is small (1MB) * Start multiple redis on the same server * The number of data to move will be small * Use docker.io, it is cool! (tested with 300 containers in the same VM) Monday, September 30, 13
between query routing and client side partitioning. * Live check (PING PONG) * Reconfiguration of nodes (ask redirection) * Slave election * Pub/sub for node insertion notifications Monday, September 30, 13