When to use key-value databases

NoSQL Concepts

Miriam Antona

Software engineer

Suitable cases

  • User sessions
    • key: session ID
    • value: session information

Image of a user

NoSQL Concepts

Suitable cases

  • User profiles and user preferences
    • key: user ID
    • value: user profile/preferences

Image of a user with his preferences

NoSQL Concepts

Suitable cases

  • Shopping carts
    • key: user ID
    • value: shopping cart information

Image of a shopping cart

NoSQL Concepts

Suitable cases

  • Real-time recommendations

Image with the text "You may also like" and three t-shirts of different colors.

NoSQL Concepts

Suitable cases

  • Advertising

Image of a computer screen where it is supposed to be an advertisement.

NoSQL Concepts

Suitable cases

  • Store the information as the value in a single object
  • Information is saved with one operation
      SET user:457:preferences {"language":"en_US","color":"green","timezone":"GTM-4"}
    
  • Information is retrieved with one operation
      GET user:457:preferences
    
  • Fast
NoSQL Concepts

Unsuitable cases

  • Search data by its value
NoSQL Concepts

Unsuitable cases

  • Search data by its value
key value
user:1:address {"street" : "123 Sesame Street" , "city" : "New York City"}
user:2:address {"street" : "742 Evergreen Terrace" , "city" : "Springfield"}
user:3:address {"street" : "221b Baker Street" , "city" : "London"}
user:4:address {"street" : "4 Privet Drive" , "city" : "Little Whinging"}
... ...

 

  • Related data
NoSQL Concepts

Let's practice!

NoSQL Concepts

Preparing Video For Download...