Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently trying to design my architecture and not sure how to set it up.

I have a lot of automated clients which I need to send messages to.

A user will connect to my server to send commands to a remote client. There are 2 key points:

  1. The command has to be sent ASAP
  2. It has to be 100% reliable. If one EC2 crashes - another instance has to be able to send the commands (they might be delayed - but they will not be lost).

The service is targeted toward corporate organization so scalability and reliability is the key factor.

All remote clients are registered in the service using a serial number and optional group tags (organization for example)

My first idea was to run few node.js instances which will listen to SQS queue and then dispatch the incoming commands to the remote clients. A command might be sent to a specific client (by its serial number) or to a group of clients (by a shared group tag - for example, a command to all AT&T clients).

The problem is that some times, the node.js servers might have an infinite loop trying to read from the SQS queue - resulting in extra charges for nothing.

If I'll use RDS to store them, again - the nodes might check the DB too many times without actual data - resulting in extra charges.

Basically, I'm thinking of few web services to handle the incoming requests (which will store them in SQS or some sort of database) and then I'll have some workers (on the same EC2 instance or another one) which will take care of dispatching the saved commands.

share|improve this question
It sounds like Amazon's SNS may be a better fit for your problem, either on its own, or integrated with SQS. SNS will actually send a notification, instead of requiring you to poll a queue. –  cyberx86 Jun 29 '12 at 5:46
The problem is that SNS only offers SMS/Email/HTTP, while my notifications use their own custom protocol (my node.js workers open a TCP connection to a remote console for sending the actual commands - which is based on a special protocl - not HTTP) –  Gilad Jun 29 '12 at 15:57
Create a web proxy service to convert an SNS HTTP Endpoint to your custom protocol. You can put that behind an ELB to handle crash recovery. –  Matt Houser Jun 29 '12 at 16:37
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.