Search code examples
amazon-web-servicesamazon-dynamodbamazon-simpledb

AWS DynamoDB or SimpleDB: "SELECT * FROM posts ORDER BY date LIMIT 10"


I'm hoping to design a serverless backend with AWS. I'm using RDS as my primary datastore, but I'd like to move heavily-queried data (lets call these records "posts") to either DynamoDB or SimpleDB because of limitations on the number of concurrent connections to my RDS instance.

At first, DynamoDB looked like a good option (lots of hype), but then I started looking to see how I would select the most recent 20 posts from my DynamoDB table, limited to 10 with an optional offset for pagination..

It doesn't look like there's an easy way to do this. I've seen some suggest using a GSI with the same partition key and a sort-key for "post_date", but it seems this is considered a hack.

SimpleDB appears to be more flexible and designed better for my use case, but it's concerning how little AWS appears to support it.

Which AWS service is best for my use case?


Solution

  • I've seen some suggest using a GSI with the same partition key and a sort-key for "post_date", but it seems this is considered a hack.

    How is that considered a hack? It sounds like you would be using Global Secondary Indexes exactly how they were designed to be used.

    SimpleDB appears to be more flexible and designed better for my use case, but it's concerning how little AWS appears to support it.

    I wouldn't use SimpleDB for any new development at this point. Amazon has basically replaced it with DynamoDB and just keeps SimpleDB around for people that were already using it.