Redis is a key-value store that can be used as a database, cache, and message broker. It supports basic data structures like strings, hashes, lists, sets, sorted sets with operations that are fast thanks to storing the entire dataset in memory. Redis also provides features like replication, transactions, pub/sub messaging and can be used for caching, queueing, statistics and inter-process communication.
29. Message pub/sub
Messages are published to channels
PUBLISH chat "Hello Redis!"
Subscribers declare which channels they’re interested in
SUBSCRIBE chat
30. Message pub/sub
Messages are published to channels
PUBLISH chat "Hello Redis!"
Subscribers declare which channels they’re interested in
SUBSCRIBE chat
Subscribers and publishers don’t care about each other
31. Message pub/sub
Messages are published to channels
PUBLISH chat "Hello Redis!"
Subscribers declare which channels they’re interested in
SUBSCRIBE chat
Subscribers and publishers don’t care about each other
Supports pattern subscription
PSUBSCRIBE f*
45. When to consider redis
You like it fast
You need more than just key value pairs
46. When to consider redis
You like it fast
You need more than just key value pairs
Small dataset that can fit into memory
47. When to consider redis
You like it fast
You need more than just key value pairs
Small dataset that can fit into memory
Your dataset isn’t critical*
48. • C • Java
• C# • Lua
• C++ • Node.js
• Clojure • Objective-c
• Common List • Perl
• Erlang • PHP
• Go • Python
• Haskell • Scala
• haXe • Smalltalk
• Io • Tcl
Snapshotting: periodically dump entire dataset to disk\n- Not durable, can lose latest data\n- every 60 seconds if there have been 1000 key changes...\n\nAOF: Append commands to a log\n- log rewriting \n- fully durable: fsync per command (slow & safe), every second (fast & pretty safe) or never (blazing & unsafe)\n\nfsync -- synchronize a file's in-core state with that on disk\n
Snapshotting: periodically dump entire dataset to disk\n- Not durable, can lose latest data\n- every 60 seconds if there have been 1000 key changes...\n\nAOF: Append commands to a log\n- log rewriting \n- fully durable: fsync per command (slow & safe), every second (fast & pretty safe) or never (blazing & unsafe)\n\nfsync -- synchronize a file's in-core state with that on disk\n
\n
\n
\n
\n
Redis virtual memory going to be scrapped in favour of disk storage\n\nBoth keys and values will be backed by disk\n
Redis virtual memory going to be scrapped in favour of disk storage\n\nBoth keys and values will be backed by disk\n
Redis virtual memory going to be scrapped in favour of disk storage\n\nBoth keys and values will be backed by disk\n
\n
\n
\n
\n
...cache invalidation and naming things\n\nPhil Karlton\n