Creating Items and Exploring Tables in Amazon DynamoDB

Having earlier created some tables for our application we will now quickly see how to store some items.

Using the AWS SDK it could be done programmatically very simply as follows:

Figure 1. Code to populate the Players Table with sample Items.

A couple points to reinforced:

  • Not all items need to have the same set of attributes
  • Attributes can be single or multi-valued

Tables can be explored interactively using the AWS Explorer from within Visual Studio.

Figure 2. Explore the Players Table using AWS Explorer from within Visual Studio

Note that item order is not preserved nor is order of list entries in multi-valued attributes.

Alternatively, as of May 22, 2012 you can also use the AWS Management Console to explore, monitor and configure DynamoDB tables.

Okay, cool. So now what? Well we could (and we will) consider ways to query the data. We could also talk about the usual CRUD stuff but we are not going to do that right now. Instead our next game will be to wrap up an interface to our storage that can be implemented as a Web Service. This will allow us to further abstract from DynamoDB and define our interface in terms of objects in our problem domain. Under the covers we will we using DynamoDB but we will have isolated specific code so that if, in the future, we wanted to use something else for storage (SimpleDB, Azure Tables or even a relational database) it will be relatively straight forward to make the necessary changes.

That will be the subject of my next post. In the meantime you might want to check out some of the supplementary course materials available for Learning Tree’s Amazon Web Services course. While some of the programming references there are for Java and not C# you will find that the concepts are equally relevant.

Kevin Kell


Learning Tree Logo

Cloud Computing Training

Learning Tree offers over 210 IT training and Management courses, including Cloud Computing training.

Enter your e-mail address to follow this blog and receive notifications of new posts by e-mail.

Join 53 other followers

Follow Learning Tree on Twitter

Archives

Do you need a customized Cloud training solution delivered at your facility?

Last year Learning Tree held nearly 2,500 on-site training events worldwide. To find out more about hosting one at your location, click here for a free consultation.
Live, online training
.NET Blog

%d bloggers like this: