valkey-data-types - Man Page
Valkey data types
Description
Valkey is a data structure server. At its core, Valkey provides a collection of native data types that help you solve a wide variety of problems, from valkey-client-side-caching(7) caching to valkey-lists(7) queuing to valkey-streams-intro(7) event processing. Below is a short description of each data type, with links to broader overviews and command references.
If you’d like to try a comprehensive tutorial for each data structure, see their overview pages below.
Strings
valkey-strings(7) are the most basic Valkey data type, representing a sequence of bytes. For more information, see:
- valkey-strings(7) Overview of Strings
- valkey-commands(7) String command reference
Lists
valkey-lists(7) are lists of strings sorted by insertion order. For more information, see:
- valkey-lists(7) Overview of Lists
- valkey-commands(7) List command reference
Sets
valkey-sets(7) are unordered collections of unique strings that act like the sets from your favorite programming language (for example, Java HashSets\c , https://docs.python.org/3.10/library/stdtypes.html#set-types-set-frozenset Python sets\c , and so on). With a Set, you can add, remove, and test for existence in O(1) time (in other words, regardless of the number of set elements). For more information, see:
- valkey-sets(7) Overview of Sets
- valkey-commands(7) Set command reference
Hashes
valkey-hashes(7) are record types modeled as collections of field-value pairs. As such, Hashes resemble Python dictionaries\c , Java HashMaps\c , and Ruby hashes\c . For more information, see:
- valkey-hashes(7) Overview of Hashes
- valkey-commands(7) Hashes command reference
Sorted sets
valkey-sorted-sets(7) are collections of unique strings that maintain order by each string’s associated score. For more information, see:
- valkey-sorted-sets(7) Overview of Sorted Sets
- valkey-commands(7) Sorted Set command reference
Streams
A valkey-streams-intro(7) Stream is a data structure that acts like an append-only log. Streams help record events in the order they occur and then syndicate them for processing. For more information, see:
- valkey-streams-intro(7) Overview of Streams
- valkey-commands(7) Streams command reference
Geospatial indexes
valkey-geospatial(7) Geospatial indexes are useful for finding locations within a given geographic radius or bounding box. For more information, see:
- valkey-geospatial(7) Overview of Geospatial indexes
- valkey-commands(7) Geospatial indexes command reference
Bitmaps
valkey-bitmaps(7) let you perform bitwise operations on strings. For more information, see:
- valkey-bitmaps(7) Overview of Bitmaps
- valkey-commands(7) Bitmap command reference
Bitfields
valkey-bitfields(7) efficiently encode multiple counters in a string value. Bitfields provide atomic get, set, and increment operations and support different overflow policies. For more information, see:
- valkey-bitfields(7) Overview of Bitfields
- The
BITFIELD
command.
HyperLogLog
The valkey-hyperloglogs(7) HyperLogLog data structures provide probabilistic estimates of the cardinality (i.e., number of elements) of large sets. For more information, see:
- valkey-hyperloglogs(7) Overview of HyperLogLog
- valkey-commands(7) HyperLogLog command reference
Extensions
To extend the features provided by the included data types, use one of these options:
- Write your own custom valkey-programmability(7) server-side functions in Lua.
- Write your own Valkey module using the valkey-modules-intro(7) modules API or check out the community-supported modules\c .
Referenced By
valkey(7), valkey-commands(7), valkey-introduction(7), valkey-programmability(7), valkey-quickstart(7).