At root, its a key-val in-mem db written in C. Also allows memory snapshots as AOF (or RDB) for persistence.
-
Primitve
stringtype. If required data structure ain't supported by Redis, can always just serialize and use this. Max length 512MB. -
Hashes for shallow objects.
-
Lists with items sorted by insertion order. Implemented with LinkedLists, so good for Queues but positional index is slower (better suited to Sorted Sets).
-
Sets, only store unique elements & do allow union/intersection/other-op.
-
Sorted Sets, ordered on (explicit) score & lexical order.
O(N)for add/del. -
GeoSpatial Index Support based on Sorted Set, with score based on Geohash algorithm.
- Hyperloglogs to get quick estimate of unique value in a huge dataset.
- This log data-structure is append-only table, allowing multiple consumers to track event data.
-
Bit-oriented op are supported on Redis strings. So, for 512MB it can manipulate 2^32 bits. Eg: usage like tracking up/down states of million sensors in a simple bitmapped string.
-
Could also be used to cache requests/configs/states, have counters. Can have expiry on key.
-
String Ops with
O(N)areAPPEND,BITCOUNT,BITOP,BITPOS,GETRANGE,MGET,MSET,MSERTNX. -
String Ops with
O(1)areBITFIELD,DECR,DECRBY,GET,GETBIT,GETSET,INCR,INCRBY,INCRBYFLOAT,PSETEX,SET,SETBIT,SETEX,SETNX,SETRANGE,SETRLEN.