Jetty is a http server in Java and Java Servlet container. Whilst web servers are often connected with ensuring the access to documents, Jetty is often used for communication between two machines, usually with bigger software framework. Jetty is an open-source project by Eclipse Foundation.
This web server is used in products, among which belongs Apache ActiveMQ, Alfresco, Scalatra, Apache Geronimo, Apache Maven, Apache Spark, Google App Engine, Eclipce, FUSE, iDempiere, Twitter’s streaming API or Zimbra.
Jetty is also used as server for open-source projects as are Lift, Eucalyptus, Red5, Hadoop or I2P. It supports the newest API for Java Servlet (with JSP support), protocols http/2 and WebSocket.
Advantages of using Jetty
Java’s flexibility. Although Eclipse Jetty can be used as web layer of full or partial Java application server stack as are Geronimo, Jboss, Sybasse EAServer, JonAS or Glassfish, these stacks are not the only solution. Jetty can be used also as base of the next application frameworks as are SIP telephones, Ajax JMS, Asynchronous SOA services. Development tools and frameworks often make use of that they can be nested. E. g. Google Widget Toolkit, Grails or Eclipse use Jetty by default or they have the connection to it. When it comes to production environment, it is ideal to execute application on same server, as where it was developed.
Efficiency. There is a huge difference for web server, if they are solving 10 000 requests per second through one TCP/IP connection or the same number of requests through 10 000 connections. Although many tests are based on, how efficient are the connections, the results of these tests don’t really correspond to the real traffic. Jetty is a fit for connection across larger amount of access points.
Scalability. Jetty is designed to be scalable during realistic load with the help of more simultaneous connections. Jetty reaches great results with tens of thousands of http connections and hundreds of thousands of simultaneous web socket connections.
Memory. Jetty uses only little of memory, which is crucial for optimal efficiency and scalability. The less memory the server uses, the more memory is available for applications or more instances of server, which can be executed on virtual hardware.
Usage through cloud. Jetty is formed to use cloud services.
Cooperation and community. Jetty’s developers like to get inspired by new ideas. Jetty also has wide community of users, who can advise and help in case of need.
Standards. Jetty’s developers set a goal that the users should use Jetty, because they chose so. Therefore, they try to implement standards and avoid proprietary API and extension. Jetty’s developers are active in JCP and IETF, where they partake in development of internet standards. It allows the standards to be implemented into Jetty earlier.
Innovation. Web is very variable environment and users expect that web application will fulfil the highest standards regarding the user experience and interactiveness. Massive share on market can be gained and lost quickly. Newly implemented protocols must be supported by server. The environment changes constantly.
Rich history. Jetty was created in 1994 as first Java http server, much earlier than the servlet specification was created.
Disadvantages of using Jetty
Less known and used then the competing Tomcat. Tomcat has more attention, support and actualizations.
Less functionalities. Competing Tomcat has more options.
Tomcat is traditionally reference implementation of Servlet specification. Jetty doesn’t profit from Servlet Test Compatibility Kit (TCK).