Example database operations of the simple key-value kind
Let us go ahead and perform read and write operations of the simple key-value kind. We will use the sample Employee
table we used in the previous chapter. If you no longer have the table or would like to bootstrap the table to follow along, instructions to set the table up are in the GitHub repository (2) in the Chapter03
folder.
If you recall or can observe, the Employee
table key schema only has a partition key: LoginAlias
. This means that each item in the table can be uniquely identified using the value of its partition key alone. For example, LoginAlias=janed
would uniquely identify the employee details of Jane Doe
, who is a developer as per the Employee
table. Let us go ahead and make a key-value lookup to read this item programmatically.
If I were to read the item from the table, I would perform a GetItem
operation against the table and pass the complete value of the LoginAlias=janed
partition key.
Let us first...