Nelz's Blog

14 July 2009

Working With Amazon SimpleDB

Filed under: General — nelz9999 @ 22:56

At Widgetbox I’ve been playing with Amazon SimpleDB to implement some features that we’ll be releasing soon. I wanted to share some of my impressions with you, but another blogger has already posted a great writeup at http://www.royans.net/arch/2009/02/28/experimenting-with-simpledb-flagthiscom/. However, I’ll add my $.02 contribution to what he posted.

#1 (“Its not a relational database.”) is very, very important. You’ve really got to stretch your brain a bit to get out of the RDBMS headspace to see how it can be beneficial. Everything is stored as a string, so if you want to any kind of sorting with regards to numbers or dates, you have to format the values to be sorted lexicographically. (This reminds me of when I was working with Lucene.)

In addition to not having any kind of auto-increment (as mentioned in that blogs #5 point), there is no concept of an “increment” operation on a field. At first I was tempted to try for a Read-Increment-Update pattern, but if you think of how that would interact with Amazon’s concept of Eventual Consistency (which, for some inexplicable reason, I find absolutely hilarious), you will realize this is a sub-optimal pattern for data integrity. (The pattern I ended up using lends itself only to the specific interaction patterns I am designing for, so I won’t bore you with the details.)

Though there is no auto-increment, many blog posts have been published recommending UUID’s, which seems to be working for me as well.

As for that blogs #8 point, there is now a offered called Javascript Scratchpad for Amazon SimpleDB, which is just a small set of HTML/JS pages that you save locally and run in a browser. I think it’s actually a pretty cool lightweight and simple GUI tool to offer.

Looking at the price list, you might think that SimpleDB could get expensive fast. But, if you read carefully you’ll see the following: “Data transferred between Amazon SimpleDB and other Amazon Web Services within the same region is free of charge (i.e., $0.00 per GB).” That’s pretty cool. As long as whatever is hitting your SimpleDB instance resides on the Amazon cloud (in the same region), you don’t pay for data transfer.

I also gotta comment on the Java client provided by Amazon. Yeah, it works, but working with it is fairly “meh”. You get the source an everything for it, but it’s not Open Source and they definitely don’t give the impression that they’re looking for any contributions. I would’ve submitted a couple of lines of documentation for some of the methods at the very least.

I’ve heard some good things about the typica library, specifically that the interaction patterns with the library are nicer than the Amazon-provided library. There only seems to be one (maybe two?) developer working on it, but at least it’s hosted on Google Code so, unlike Amazon, maybe the developer would welcome contributions.

I haven’t used typica myself yet, but since I’m not too far down the other path, maybe I’ll check it out.

4 Comments »

  1. I’ve played with their PHP library and can say that it’s nothing special, either. It feels very corporate and very sterile. There’s no love in that code at all.

    And I’m curious about how you’re storing that information…by any chance are you just concat-ing a character in every time and returning the string length? I would express some lulz if you were.

    Comment by Matt — 15 July 2009 @ 09:45

  2. Typica is a really good library and the creator, David Kavanaugh, is first class.

    Comment by Charlie — 17 July 2009 @ 22:44

  3. For a good PHP library, look at Tarzan. SDB, S3, EC2, SQS. http://tarzan-aws.com/

    Comment by Jacob Marble — 25 July 2009 @ 12:33

  4. SDB Explorer has been made as an industry leading graphical user interface (GUI) to explore Amazon SimpleDB service thoroughly and in a very efficient and user friendly way.

    Comment by SDB Explorer — 11 April 2011 @ 22:33


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.