Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.87 KB

redis-data-types.md

File metadata and controls

51 lines (40 loc) · 1.87 KB

Back to Home

The Overview of Redis Data Types

Redis supports the following data types:

  1. Strings: The most basic data type in Redis, used to store any kind of text or binary data, such as serialized objects, JSON, or plain text.

  2. Lists: A collection of ordered strings, similar to a linked list, that supports push and pop operations on both ends.

  3. Sets: An unordered collection of unique strings, which can be used to perform set operations such as union, intersection, and difference.

  4. Sorted sets: A set that is ordered by a score associated with each member. This data type is useful for scenarios that require ranking, such as leaderboards or top scores.

  5. Hashes: A collection of key-value pairs, where each key maps to a value. This data type is useful for storing objects that have multiple fields.

  6. Bitmaps: A data type that can represent a set of bits, which can be manipulated using bitwise operations.

  7. HyperLogLogs: A probabilistic data structure used to estimate the cardinality of a set, using a small amount of memory.

  8. Geospatial indexes: A data type that can store geographical locations and perform operations such as distance calculation and radius queries.

  9. Streams: A data type that represents a sequence of messages, where each message is a key-value pair. This data type is useful for implementing message queues, event sourcing, and other streaming scenarios.

  10. Redis Modules: Redis also supports extensions through Redis Modules, which can introduce new data types and commands. Some popular Redis modules include RediSearch for full-text search, RedisGraph for graph data processing, and RedisTimeSeries for time-series data.

Each data type has its own set of operations and commands in Redis, allowing developers to choose the most appropriate data type for their use case.