Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering DynamoDB

You're reading from   Mastering DynamoDB Master the intricacies of the NoSQL database DynamoDB to take advantage of its fast performance and seamless scalability

Arrow left icon
Product type Paperback
Published in Aug 2014
Publisher Packt
ISBN-13 9781783551958
Length 236 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Tanmay Deshpande Tanmay Deshpande
Author Profile Icon Tanmay Deshpande
Tanmay Deshpande
Arrow right icon
View More author details
Toc

Primary key

DynamoDB, being a key-value pair database, does not index on all given attributes for a given item; it only indexes on the primary key, which is a mandatory attribute for each item of the table.

DynamoDB supports two types of primary keys:

  • Hash primary key
  • Hash and range primary key

Hash primary key

Each DynamoDB table must have a hash primary key that is unique for each item. DynamoDB builds an unordered hash index on this key that allows us to uniquely identify any given item for a given table. So, while designing your table, you must choose an attribute that would have a unique value for each attribute. For example, while creating Person table, choosing Social Security Number (SSN) as a hash key would be a better option as compared to selecting a person's name as hash key, as there might be more than one person having the same name.

Hash and range primary key

Along with the hash key, DynamoDB also supports another primary key called range key, which can be used in combination...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image