Amazon recently released their new data service, known as SimpleDB, which allows one to store data in the cloud.
SimpleDB is a very simple database system which works on the basis of domain (a table), item (a row), and attributes (columns in a row). These are very closely related to an RSSBus feed which also contains a table (the feed itself), a row (the item), and columns (attributes).
The similarity of SimpleDB and RSSBus means two things: Feeds can be easily stored in a SimpleDB domain, and a SimpleDB domain can easily be represented as a feed.
We have created scripts illustrating both of the previously mentioned scenarios, and both of these scripts in their entirety are included as demos when you
download the new SimpleDB connector.
Store a feed in a SimpleDB domain:
<!-- Retrieve the feed -->
<rsb:call op="feedGet?feed=[feedurl]" out="myout">
<!-- Enumerate through each attribute in the feed -->
<rsb:enum item="myout">
<!-- Set the attribute name to be stored in the SimpleDB Database -->
<rsb:set attr="myin.attrs:[ _attr ]" value="[ _value ]" />
</rsb:enum>
<!-- Use the GUID as the ItemName so it is always unique -->
<rsb:set attr="myin.itemname" value="[ rss:guid ]" />
<!-- Push the item to SimpleDB -->
<rsb:call op="simpledbPutItem" in="myin" />
</rsb:call>
The script to create a feed from a SimpleDB domain is even easier:
<!-- Setting fetchattributes to True will automatically retrieve the attributes for each ItemName -->
<rsb:set attr="myin.fetchattributes" value="True" />
<!-- Iterate through all of the items in the domain -->
<rsb:call op="simpledbGetItems" in="myin" out="myout">
<!-- Push each Item as an RSS Item -->
<rsb:push item="myout" />
</rsb:call>
The new SimpleDB connector makes interacting with SimpleDB incredibly easy. Aside from the two scripts mentioned above, the new connector also has the ability to perform any and all operations on a SimpleDB, such as creating a domain, deleting a domain, adding and deleting rows, and adding and deleting attributes.