amazon's simpledb might be toosimpledb

December 18, 2007 under Amazon, SimpleDB

Late last week, Amazon announced a new addition to their family of Web Services known as SimpleDB. Essentially, it’ll allow developers to use an Amazon-hosted database system without needing to worry about things like maintenance and scalability. Like all of Amazon’s Web Services, there’s no monthly fee – you only pay for what you use.

To me, this sounds ideal for startups who would prefer to manage as few systems as possible. Yet there’s something about how SimpleDB actually stores data that leaves me wondering. My primary concern is how SimpleDB doesn’t support something similar to the concept of tables in the RDBMS world and instead uses “domains”. According to Amazon’s SimpleDB Getting Started Guide:

Domains are similar to database tables, except that you cannot perform functions across multiple domains, such as querying multiple domains or using foreign keys. As a result, you should plan a Amazon SimpleDB data architecture that will meet the needs of your project.

Note:
Although the Amazon SimpleDB API cannot perform queries across multiple domains, you can design your applications to perform queries across multiple domains.

While I can appreciate this simplicity, I think it introduces a new set of things to worry about from an application architecture perspective. I’ve whipped up a quick RDBMS database schema for a simple e-commerce application:

Database Schema for a Simple E-Commerce Site

Just by looking at the schema diagram, it’s obvious how the application will work and where data will flow. Now let’s suppose that we are to use Amazon’s SimpleDB instead of an RDBMS like Microsoft SQL Server, Oracle or MySQL. How would we do it?

We could use a single domain and store everything in it, but that would be slightly messy, even in this simple example. We’d have a lot of columns such as email address, all of the address fields, product name, product price, quantity, order date and so on. Imagine if our application was more complex; we’d have a crazy number of columns in that domain.

Perhaps we can use separate domains much like how we do with our tables in an RDBMS. Still, we need to remember that we have no way to link SimpleDB domains at the database level. If we’re implementing an n-Tier architecture, then this would need to be done in another tier such as the data access or Web layer. In an MVC architecture, perhaps this would need to be done in the Controller layer.

The beauty of an RDBMS is that much of the interaction with the database can be done at the database level, so that none of that logic needs to mingle with the business logic or user interface; nice ‘n’ decoupled. I’ve signed up for a SimpleDB Beta account, and when I’ve received access to it, I’ll be sure to try a few things out.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>