A key value server, also known as NoSQL database.
Default port is TCP/6379.
Values can have an expire time.
Once the server is running, command line REPL interface:
TODO check everything bellow, in particular if MySQL can do each of those things.
Can store complex data structures like lists, sets and maps, MySQL only represents those structures indirectly with tables and columns.
Loads all of it’s data on RAM, persists it by default to disk. Therefore faster than MySQL which always reads from disk TODO check but it can store much less data. TODO possible to not load everything on RAM?
Only saves modifications to disk from time to time, thus lower durability, and greater performance.
Pipelining support: multiple operations on a single HTTP request.
Things Redis can’t do that RDMSs can
As far as we can tell:
SET and GET
Set value to string:
SET key "val space"
SET key val GET key
Only works for value without spaces:
SET key val space
(error) ERR syntax error
Increment integer (concurrency safe):
SET key 0 INCR key GET key
Only works for integers:
SET key a INCR key
(error) ERR value is not an integer or out of range
Undefined key returns nil:
SET key DEL key GET key
Base data type.
There is no integer data type, only strings that can be converted to integers or not.
LPUSH list a LPUSH list b RPUSH list c
Get entire list:
LRANGE list 0 -1
1) "b" 2) "a" 3) "c"