Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
A Brief Introduction to Redis
1. A Brief Introduction to
Redis
Charles Anderson
!
Salem Dynamic Languages User Group
January 2014
2. Overview
• Redis is a networked “data structure
server”
• Fast, powerful, simple
3. Abstract Data Types
• In the Before Time, we didn’t have classes
and objects - we had abstract data types
•
and, we liked it!
• Procedural interface
• First (or last) parameter is the ADT
5. Stack ADT
• We had a single, global name space. So:
• stack_push(stack, item)
• stack_pop(stack)
• stack_size(stack)
• This is what the Redis API looks like
12. Complete Redis API
• http://redis.io/commands
• Each command includes the time
complexity of the operation - unique
13. Set
• SADD key member, SREM key member
• SCARD key
• SISMEMEBER key member
• SINTER, SUNION
14. Sorted Set
• ZADD key score member
• ZSCORE key member
• ZRANK key member
• ZRANGE key start stop
• Use case: leader board
15. Hash
• HSET key field value
• HGET key field
• HEXISTS key field, HKEYS, HLEN
• Use case: a structured record like User
16. Other Stuff
• Key Expiration
• Transactions/batches
• Publish-Subscribe
• Server-side scripting via Lua
• Replication
• Clustering
17. Implementation Details
• Everything is stored in memory
•
•
Hella fast
Not memcache - expiration is not LRU
• Persistent - tunable disk storage
• Single-threaded - simple, fast, single CPU
• Support (@antirez) is awesome
18. But, is it Web
Scale?
• NoSQL key/value store
• Kickass benchmarks
• Simpler (smaller scope) than HBase or
Cassandra
• Sharding done by clients
• Not usually a system of record
• I already work on a farm