Database Reference
In-Depth Information
Therefore, during the creation of the Tbl_Book table in DynamoDB, we will specify
only the BookTitle and Author attributes. All other attributes can be specified while
inserting an item into this table.
Let's assume that Tbl_Book has been created in DynamoDB with BookTitle and
Author attributes as the hash and range key. We will now insert four items into the table
as shown:
One quick question: while inserting the first item into the table, do we need to specify the
PubDate attribute as null? The answer is no; every item can have its own attributes,
along with mandatory primary key attributes specified during table creation. In fact, if we
want to insert a fifth item with a new attribute named CoverPhoto , we can do it without
affecting the previous four items.
Tip
Unlike RDBMS tables, the attributes (that is, what we call columns in RDBMS) of Dy-
namoDB tables are stored in the item itself as a key-value pair. The attribute name be-
comes the key and the attribute value becomes the value. So every item will have its own
attributes. There is a tradeoff here. Fetching a record will not only fetch the attribute
value, but also its attribute name. So if you choose very long attribute names, then the ef-
ficiency will decrease.
Let's take a look at a few valid table schema that are supported by DynamoDB:
Search WWH ::




Custom Search