Hurley's World

  • games
  • genealogy
  • videos
  • contact
Home › Blogs › tracy's blog

Thoughts on Amazon Simple Queue Service (SQS)

The sites/tracy.hurleyit.com/files/img_thumbnails is not writeable

tracy — Tue, 12/02/2008 - 14:56

I've moved some of our queues from a MySQL table to Amazon's Simple Queue Service (SQS). The main reason I did this is that we are processing more than a million tasks a day using at least 4 servers and that amount of processing in a database situation was a bit more than I could handle. I haven't been able to move all of our queues over, in part due to the 8k message limit, but it's been great for the queues moved over thus far.

That said, there are a few things to keep in mind about SQS. First, I get a significant number of 500 errors when making various requests. I'm using the Amazon::SQS::Simple module from CPAN and had to wrap it in my own custom module to handle errors and making the request again if it originally failed. Given the frequency of error, it's definitely something to keep in mind.

In addition to 500 errors, it's important to note that Amazon SQS has an issue handling utf-8 characters. According to a bug report for that module, Amazon is aware of this issue and is working on a fix. Apparently it is also an error with some other services, but I'm not sure which ones. One work around is to encode the message text in base64. Fortunately, the messages I need to save are small enough where I can do this encoding and still have room to meet the 8k limit. If I did not have enough room, I could also compress the message text.

Also, while they aren't important for my current project, there are two other handy tidbits regarding the service. First, it's a loose First In, First Out (FIFO) system, which means that messages won't always be returned in the order they were added. Second, due to the system architecture, your information is kept on multiple servers that might not be in complete sync at all times. This means that there is no guarantee you won't get the same message more than once even after you've deleted it or that a request for messages will return all messages you've sent.

A really handy book for learning more about SQS and other Amazon services is Programming Amazon Web Services: S3, EC2, SQS, FPS, and SimpleDB (Programming)

Trackback URL for this post:

http://tracy.hurleyit.com/trackback/1154
  • amazon
  • sqs
  • web development
  • tracy's blog
  • Add new comment

  • @PaperlessRead Thanks! — 13 years 1 week ago
  • @Lisa03755 Thanks for the mention! — 13 years 1 week ago
  • In #drupal 7, is there a best practice for maintaining certain users across multiple drupal sites? — 13 years 29 weeks ago
  • At #mongoboston. Lots of great sessions on the schedule. — 13 years 31 weeks ago
  • @qh_murphy I hear that. I try to stay away from Windows XP for similar reasons. — 13 years 38 weeks ago
  •  
  • 1 of 17
  • ››
more

Navigation

  • Recent posts

User login

  • Create new account
  • Request new password
Connect
Sign in using Facebook

Hurley's World Community


Hurley's World on Facebook

  • games
  • genealogy
  • videos
  • contact

© Copyright 2009: Tracy Hurley