Key/Value API v0.5.8

Introduction

Data types

Data modeling

String commands

List commands

Set commands

Sorted set commands

Hash commands

Data types summary

All Key/Value API data types can be thought of as either unordered collections or ordered sequences of items. Collections and sequences can then be further classified as either unique or non-unique.

The table below shows each data type, its ordering and uniqueness guarantees, and the best use cases for the type.

Ordered Unique Best for
String Indexed No
  • Cache (text, JSON, binary)
  • Counting
List Insertion No
  • Fast head/tail operations
  • Recent items
Set No Yes
  • Existence / membership
  • Set operations
Sorted Set Score Yes
  • Top x items
  • Set operations
Hash No Yes
  • Cache
  • Database row / document

Best uses above only show use cases for individual types and do not include composite solutions.