I wanted to try out Amazon’s new DynamoDB service so yesterday while watching 14 hours of football and football games I wrote a script to track my Twitter followers and unfollowers. Here’s my first impressions.
Old habits die hard
I’ve played with various NoSQL stuff like Redis and Mongo in passing, but never really built anything beyond a hello world. I have a ton of experience with relational databases and it’s very hard for me to shift my mindset and break old habits. For instance, my data model for this script was ridiculously simple: a user ID in a table. I thought I would just use the scan
functionality to return the whole table but table scans are not recommended. Instead I just used a common hash key and put the user ID into the range key. Queries over hash keys are fast and easy so it worked out fine.
boto is very nice
I wrote this script in Python which has a great third-party wrapper for Amazon Web Services called boto. It’s very complete and basic support for DynamoDB was added just a few days after it launched. It still has some feature gaps (like scan) but overall I was able to get what I needed out of it.
I still like Python a lot
Python syntax is pretty awesome, except for some of the self
passing. I do miss LINQ from C# though. That would have made some of the list checking a lot easier. Between Google and Stack Overflow though I was able to find good short snippets to do what I needed to do when I got stuck. And requests for Python is my favorite HTTP client I’ve used on any platform.
SendGrid rocks
Dead simple REST API to send email. Since I plan on running this as a Heroku worker process I didn’t want to mess with SMTP. I have it set up to email the results when it’s done processing.