Download SimpleDBExplorer project files and executable
Introduction to Amazon SimpleDB
The best description of the Amazon SimpleDB service is given by Amazon itself here:
Amazon SimpleDB is a highly available and flexible non-relational data store that offloads the work of database administration. Developers simply store and query data items via web services requests and Amazon SimpleDB does the rest. Unbound by the strict requirements of a relational database, Amazon SimpleDB is optimized to provide high availability and flexibility, with little or no administrative burden. Behind the scenes, Amazon SimpleDB creates and manages multiple geographically distributed replicas of your data automatically to enable high availability and data durability. The service charges you only for the resources actually consumed in storing your data and serving your requests. You can change your data model on the fly, and data is automatically indexed for you. With Amazon SimpleDB, you can focus on application development without worrying about infrastructure provisioning, high availability, software maintenance, schema and index management, or performance tuning.
Amazon stresses that SimpleDB is optimized for high availability, thaks to distributed replicas of data, and low administrative costs, as there are no schemas and indexes to manage. With SimpleDB, you don't have to define a schema for each database table before you can use it, and you don't have to change that schema before storing your data in a different way. As there is no schema, there are no data types, as all data values are treated as variable length char data. So, if you want to add a new field to an existing database, you just data the new field to the data items that require it, and there is no enforcing that all data items contains the same fields. The drawback of having no schema is that you have to handle formatting and type conversions in your code, and this has a serious impact on queries.
The terminology used in SimpleDB is different from the usual DBMS one, so the following table shows how the different terms are related:
DBMS |
Amazon SimpleDB |
table |
domain |
row |
item |
column |
attribute |
The domain is analogous to a database table, but a domain has no schema, so the only parameter you can set is the name of the domain. All the data stored in a domain has the form of name-value attribute pairs, and each attributes pair belongs to an item, which is similar to a table row. The attribute name is similar to a table column, but each item can have different attribute names, so you can store data with different layouts in the same domain, and add new fields to items without restructuring the table. It is also possible to have, for a given attribute, not just one value, but an array of values, so when you add an attribute name-value pair to an item, you can choose if SimpleDB should replace the existing pair with the same attribute pair, or add the new value to the existing pair.
Queries on SimpleDB are mostly done with a key-value approach, where you retrieve an item and its attributes from the item's name. But you can also use a SQL-style query language to issue queries over the scope of a single domain. When designing queries, you should be aware that all the data stored in SimpleDB is treated as plain string data (be careful with numerical data!), and that all values are automatically indexed.