Question

I am exploring AWS, and I'd like to implement in Java EE an EC2 app like the Online Photo Processing Service example in Getting Started with Amazon EC2 and Amazon SQS (PDF). It has a web-based client that submits jobs asynchronously to a client-facing web server app that then queues jobs for one or more worker servers to pick up, run, then post back to a results queue. The web server app monitors the results queue and pushes them back to the client. The block diagram is here.

How would you implement an app like this using Java EE, i.e., what technologies would you use for the servers in the diagram? We're using AWS because our research algorithms will require some heavy computation, so we want it to scale. I am comfortable with AWS basics (e.g., most things you can do in their management console - launch instances, etc), I know Java, I understand the Java AWS APIs, but I have little experience on the server side.

Was it helpful?

Solution

There are many possibilities to solve your problem, go with the simplest one for you. Myself, I would build a simple Java EE 6 (based on weld) web application with Amazon SQS dependency, this web application would send messages to AWS based SQS, another instance (possibly based on stateless EJB's) again with Amazon SQS dependency, which would read incoming messages and process them, you can use stateless EJBs as web service to process data synchronously, set the EJB pool size for each server instance depending on the processing load you need etc..

OTHER TIPS

Most of the functionality in J2EE is way over the top for the majority of tasks. Start trying to implement this by using basic servlets. Keep the code in them as stateless as possible to assist with scaling issues. Only when servlets have some architectural flaw that prevent you completing the task would I move onto something more complex.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top