Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was studying about the infrastructure being used by Facebook, as I was developing a website based on social interaction for a university project.

Facebook is using Tornado Web Server as its scalable, non-blocking web server, but it's written for Python. I'm trying to find something similar for Java: what should I be looking at? What are your experiences in non-blocking web servers for Java?

share|improve this question
    
Also, take a look at webbit –  Davorin Ruševljan Oct 7 '11 at 12:47
add comment

migrated from stackoverflow.com Oct 6 '11 at 19:41

This question came from our site for professional and enthusiast programmers.

3 Answers

Netty

Netty is a high performance event-driven network framework that has support for HTTP and other common protocols. Netty uses non-blocking I/O. But it's pretty low level to use.

Play Framework

Play Framework is a modern web framework for both Java and Scala. It has a very short development cycle - just save your file and update your browser. It's inspired by Ruby on Rails. Play Framework is by default based on Netty (embedded), but it can also be used in a Java Servlet container as a war-file.

I have been using Play Framework in a few months. It's a framework that is easy to use and it has very good performance since it's based on Netty. If you have done some GUI programming e.g. using Swing then you have done event-driven programming before and it's the same principles: Do all long-running processing in a background thread, otherwise your server will be blocked like a GUI is blocked when the thread is used incorrectly.

share|improve this answer
add comment

You can use ngnix as a proxy in front of a java container. The problem that Tornado and ngnix solves is that the io on the sockets is event driven instead of blocking, which limits your standing connections to something like 10,000. In a java environment you can use ngnix as a reverse proxy/load balancer for one or more java containers and achieve similiar scalability. There are projects like netty from jboss that are starting to address this problem for the java space, but I'm not sure if there are any commercial implementations using it.

share|improve this answer
add comment

There has been some activity around building a web server on top of Apache Mina, but I'm not sure how far along it is. The webpage is currently pretty light on details.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.