Reader small image

You're reading from  AWS Certified Database – Specialty (DBS-C01) Certification Guide

Product typeBook
Published inMay 2022
PublisherPackt
ISBN-139781803243108
Edition1st Edition
Right arrow
Author (1)
Kate Gawron
Kate Gawron
author image
Kate Gawron

Kate Gawron is a full-time senior database consultant and part-time future racing driver. She was a competitor in Formula Woman, and she aspires to become a professional Gran Turismo (GT) racing driver. Away from the racetrack, Kate has worked with Oracle databases for 18 years and AWS for five years. She holds four AWS certifications, including the AWS Certified Database – Specialty certification as well as two professional Oracle qualifications. Kate currently works as a senior database architect, where she works with customers to migrate and refactor their databases to work optimally within the AWS cloud.
Read more about Kate Gawron

Right arrow

Querying and scanning a DynamoDB table

DynamoDB has two different methods of retrieving data:

  • Query
  • Scan

DynamoDB is designed to be queried only by the key attributes. This means that if you wanted to query an attribute that wasn't a part of the key, then you would need to scan the entire table. This is fine for small tables, but as they grow in size the performance of the queries will rapidly decline. If you are from a SQL database background you can think of this in similar terms to a query being run against a table without an index. In addition to performance concerns, in DynamoDB, the more data you access in a table the more it costs, so queries that involve scanning the entire table can become costly. A query method can only be used if you are querying against the partition key, and a scan method is used if you are not using the partition key.

Let's take a look at an example using our high score table. If we want to get the high score for a player...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
AWS Certified Database – Specialty (DBS-C01) Certification Guide
Published in: May 2022Publisher: PacktISBN-13: 9781803243108

Author (1)

author image
Kate Gawron

Kate Gawron is a full-time senior database consultant and part-time future racing driver. She was a competitor in Formula Woman, and she aspires to become a professional Gran Turismo (GT) racing driver. Away from the racetrack, Kate has worked with Oracle databases for 18 years and AWS for five years. She holds four AWS certifications, including the AWS Certified Database – Specialty certification as well as two professional Oracle qualifications. Kate currently works as a senior database architect, where she works with customers to migrate and refactor their databases to work optimally within the AWS cloud.
Read more about Kate Gawron