advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.” Created by Salvatore Sanfilippo (aka antirez) Wednesday, August 7, 13
2: Serve data from memory 3: Fundamental data structures and API 4: Code is like a poem 5: Fight against complexity 6: Two levels of API 7: Optimize for joy Wednesday, August 7, 13
Single-threaded • Supports Pipelining (multiple command without waiting for reply in between) • Supports Master-Slave replication • Transactional grouping of commands • Lua scripting • Redis Sentinel for monitoring • Notification system • Automatic failover • Client configuration server • Slow log • In memory log of responses over specified time (in microseconds) • Built-in benchmarking tool for configuration testing Wednesday, August 7, 13
Store up to 2^32 - 1 (4,294,967,295) values in the list • Can be used for queueing service • 17 commands available • LSET / LINDEX / LINSERT / LREM • LPUSH / LPOP / LTRIM • BRPOP / BLPOP / BRPOPLPUSH Wednesday, August 7, 13
Memcache, MongoDB, Sphinx, Filesystem • Primary repository of posting activity metadata used in analysis tasks • High usage of Sorted Sets • Replication across 2 data centers Wednesday, August 7, 13
feed • Sessions • Runs on several Quadrupal Extra-Large Memory instances (68.4GB of RAM) • Redis Faina https://github.com/Instagram/redis-faina • Leverages Redis’ MONITOR command to collect data and analyze (written in Python) Wednesday, August 7, 13
disk usage • Building tarballs • Firing off web hooks • Creating events in the db and pre- caching them • Building graphs • Deleting users module GitHub module Config def self.[](key) $redis.get("gh:cfg:#{key}") end def self.[]=(key, value) $redis.set("gh:cfg:#{key}", value) end end end Also, configuration storage Wednesday, August 7, 13
hashes instead of multiple keys for more efficient storage • Make sure you plan out your memory for your server accordingly • If you are building a URL shortener and you want to use QR codes... Wednesday, August 7, 13