Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 1.77 KB

mastering redis.md

File metadata and controls

45 lines (38 loc) · 1.77 KB

Mastering Redis

Database features

  • Replication
  • Tunable levels of durability
  • Cluster
  • High availability
  • Latency Doctor

Redis Operations

  • Set primitive types
  • Expiration set EX
  • Persist normally
  • TTL to query time
    • -1 for persist
    • -2 for expired
  • List - ordered
    • RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP
  • Set, Sorted Set, Hashes
  • PSubscribe, Publish, Subscribe

Commands

  • DECR, DECRBY, DEL, EXISTS, EXPIRE, GET, GETSET, HDEL, HEXISTS, HGET, HGETALL, HINCRBY, HKEYS, HLEN, HMGET, HMSET, HSET, HVALS, INCR, INCRBY, KEYS, LINDEX, LLEN, LPOP, LPUSH, LRANGE, LREM, LSET, LTRIM, MGET, MSET, MSETNX, MULTI, PEXPIRE, RENAME, RENAMENX, RPOP, RPOPLPUSH, RPUSH, SADD, SCARD, SDIFF, SDIFFSTORE, SET, SETEX, SETNX, SINTER, SINTERSTORE, SISMEMBER, SMEMBERS, SMOVE, SORT, SPOP, SRANDMEMBER, SREM, SUNION, SUNIONSTORE, TTL, TYPE, ZADD, ZCARD, ZCOUNT, ZINCRBY, ZRANGE, ZRANGEBYSCORE, ZRANK, ZREM, ZREMRANGEBYSCORE, ZREVRANGE, ZSCORE

  • Cache policy

    • Write Through
    • Write back ****
    • LRU
  • Redis cluster only supports database 0, logical
  • Keys are not production safe, Scan is
  • Del remove key and memory removed, Unlink only breaks the link, memory reclaimed asynchronously
  • Exist, Set two round time trip to remove with NX, XX
  • EXPIRE HANDLE
  • With set maintenance currently

References