Simple Primary Key: This is composed of one attribute called the Partition Key. The primary key is used to uniquely identify each item in an Amazon DynamoDB table. Uniquely Identifying Items in a Table with Primary Key In our example, each order item has OrderValue, OrderDate as scalar attributes and products list as a nested type attribute. Most of the attributes are scalar like strings and numbers while some are of nested types like lists, maps, or sets. They are similar to columns in a relational database.Įach item has its own attributes. An item is composed of attributes, which are different elements of data for a particular item. Each order is uniquely identified by a combination of customerID and orderID.Ī table contains one or more items. This diagram shows the organization of order records placed by a customer in a Order table. Other than the primary key, we do not need to define any additional attributes when creating a table. Like in many databases, a table is the fundamental concept in DynamoDB where we store our data. Here we will only skim through the main concepts that are essential for designing our applications. There is plenty to know about DynamoDB for building a good understanding for which we should refer to the official documentation. Both the keys and the values can be simple or complex objects. A key-value database stores data as a collection of key-value pairs.
AWS DYNAMODB CLIENT CODE
This article is accompanied by a working code example on GitHub.Īmazon DynamoDB is a key-value database. In this tutorial, we will look at using the DynamoDB database in microservice applications built with Spring Boot along with code examples. AWS DynamoDB is a NoSQL database service available in AWS Cloud.ĭynamoDB provides many benefits starting from a flexible pricing model, stateless connection, and a consistent response time irrespective of the database size.ĭue to this reason, DynamoDB is widely used as a database with serverless compute services like AWS Lambda and in microservice architectures.