Professional Documents
Culture Documents
REmote DIctionary Server
REmote DIctionary Server
Redis Installation
Q.What is Redis actually? Choose the correct answer.
1.database
2.cache
3.message broker
4.streaming engine
“When I say that Redis is a database, I’m only telling a partial truth. Redis is a very
fast non-relational database that stores a mapping of keys to five different types of
values.Redis supports in-memory persistent storage on disk, replication to scale
read performance, and client-side sharding to scale write performance. That was a
mouthful, but I’ll break it down by parts.”
- Josiah L.
Carlson,Redis In Action ,Section 1.1
1.Memcached only support append
command natively.
1. Store the list as a string: Items are added to the end of this string, one after another, separated by a
delimiter (e.g., comma).
2. Blacklist unwanted items: To "remove" an item, a special flag is prepended to its string representation,
indicating it's no longer considered part of the active list.
3. Read and filter: When retrieving the list, the application needs to read the entire string, then filter out the
blacklisted items based on the flag.
● Read/update/write overhead: Every list operation requires reading the entire string, potentially from the
database, modifying it, and writing it back.
● Complexity: The code for manipulating the list and handling blacklisted items becomes more complex
compared to using dedicated data structures.
Structure type What it contains Structure read/write ability
LIST Linked list of strings Push or pop items from both ends, trim
based on offsets, read individual or multiple
items, find or remove items by value
SET Unordered collection of unique strings Add, fetch, or remove individual items,
check membership, intersect, union,
difference, fetch random items
HASH Unordered hash table of keys to values Add, fetch, or remove individual items,
fetch the whole hash
ZSET (sorted set) Ordered mapping of string Add, fetch, or remove individual values,
members to floating-point fetch items based on score ranges or
scores, ordered by score member value
STRINGS: