Amazon SimpleDB
Getting Started Guide (API Version 2009-04-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Put Data into a Domain in Amazon SimpleDB

After creating a domain, you are ready to start putting data into it.

Launch instance

Domains consist of items, which are described by attribute name-value pairs. For a better understanding, consider the following spreadsheet model.

The following components correspond to each part of a spreadsheet:

  • Customer Account—Represented by the entire spreadsheet, it refers to the Amazon Web Services account to which all domains are assigned.

  • Domains—Represented by the domain worksheet tabs at the bottom of the spreadsheet; domains are similar to tables that contain similar data.

    You can execute queries against a domain, but cannot execute queries across different domains without programming at the application level.

  • Items—Represented by the spreadsheet rows, items represent individual objects that contain one or more attribute name-value pairs.

  • Attributes—Represented by the spreadsheet columns, attributes represent categories of data assigned to items.

  • Values—Represented by the spreadsheet cells, values represent instances of attributes for items.

[Note]Note

Unlike a spreadsheet, multiple values can be associated with a cell. For example, an item can have both the color values red and blue.

Amazon SimpleDB does not require the presence of specific attributes. You can create a single domain that contains dissimilar item types.

This section describes how to put the following data into the imaginary clothing/auto parts store Off the Rack and Pinion. The following table contains the information that you will add, modify, and perform queries against.

IDCategorySubcategoryNameColorSizeMakeModelYear
Item_01ClothesSweaterCathair SweaterSiameseSmall, Medium, Large   
Item_02ClothesPantsSweatpantsBlue, Yellow, PinkLarge  2006, 2007
Item_03Car PartsEmissionsO2 Sensor  AudiS42000, 2001, 2002
[Important]Important

To continue with this scratchpad exercise, you must add the data so you can manipulate it.

To put items into the domain

  1. Select PutAttributes from the scratchpad Explore API list box.

    The PutAttributes page displays.

  2. Add the following attribute-value pairs for Item_01:

    1. Enter MyStore in the Domain Name field.

    2. Enter Item_01 in the Item Name field.

    3. For the first name-value pair, enter Category in the Name field and Clothes in the Value field. Enter false in the Replace field or leave it blank.

    4. Click the plus button (+) to add each of the following additional name-value pairs:

      • Subcategory: Sweater

      • Name: Cathair Sweater

      • Color: Siamese

      • Size: Small

      • Size: Medium

      • Size: Large

  3. Click Invoke Request.

    The name-value pairs are stored in Amazon SimpleDB

    [Note]Note

    After you invoke the request, the values remain on the web page to make the next request easier.

  4. Add the following attribute-value pairs for Item_02, and then click Invoke Request:

    1. Enter Item_02 in the Item Name field.

    2. For the first name-value pair, enter Category in the Name field and Clothes in the Value field. Enter false in the Replace field or leave it blank.

    3. Add each of the following additional name-value pairs:

      • Subcategory: Pants

      • Name: Sweatpants

      • Color: Blue

      • Color: Yellow

      • Color: Pink

      • Size: Large

      • Year: 2006

      • Year: 2007

  5. Add the following attribute-value pairs for Item_03:

    1. Enter Item_03 in the Item Name field and then click Invoke Request.

    2. For the first name-value pair, enter Category in the Name field and Car Parts in the Value field. Enter false in the Replace field or leave it blank.

    3. Add each of the following additional name-value pairs:

      • Subcategory: Emissions

      • Name: O2 Sensor

      • Make: Audi

      • Model: S4

      • Year: 2000

      • Year: 2001

      • Year: 2002

Your domain contains data and is ready to use.

 

Get data