liveBook · Manning

Key-value store

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A key-value store is a data store that associates unique keys with corresponding values rather than organizing data into relational tables.

A key-value store keeps an item under a unique key, much like a hash table. DynamoDB is a managed key-value store with document support: it persists items and organizes them into tables, such as separate tables for users and tasks. These are not relational tables queried with SQL; an application sends requests through the AWS SDK. section 12.0 section 12.1

Design keys around the data your application needs to retrieve. A key is usually the direct way to find an item, so choosing one without considering later lookups can cause difficulties. DynamoDB also provides secondary-index lookups and scans. For applications with heavy or uneven request traffic, its ability to scale is a reason to consider it—but an existing SQL application cannot simply switch databases without code changes. section 12.4 section 12.0

Users and tasks

A Node.js command-line to-do application can store users and tasks in separate DynamoDB tables. Its commands add and remove items, mark tasks done, and list tasks using filters. It integrates with DynamoDB through the AWS SDK rather than issuing SQL. section 12.1

An in-memory data store serves a different role when placed between an application and its primary database. In a game, Redis can hold a rapidly accessed leaderboard and cached player information while the relational database remains the primary store. Keeping that cached data fresh requires a caching strategy; DynamoDB Streams can supply table changes when populating a cache from DynamoDB. section 11.0 section 12.4

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Defines keyed items, then develops application commands and retrieval choices; does not describe storage internals.
Examples
Uses a command-line to-do application with users and tasks, plus a Redis-backed game leaderboard.
What it assumes
Introduces keyed items through a hash-table analogy but expects application code for the hands-on DynamoDB implementation.
What you can do after
Build it from scratch: implement a Node.js to-do application using the AWS SDK and plan how its items will be retrieved.
How it connects
Connects key-value stores to NoSQL, DynamoDB tables, secondary indexes, scans, caching, and Redis.

Also explained in

Compare how 8 books explain key-value store →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.