18

What is the pros and cons of using Servlet Containers (like Apache Tomcat) in contrast with using NIO frameworks (such as Netty and Grizzly) for hosting a JAX-RS RESTful service?

I'm going to develop a RESTful application using Java. Java has JAX-RS API (JSR 331 and JSR 339) for building RESTful services. There is different implementation for it as you can see here. All of them implement JAX-RS API and so it should be easy (at least in theory) to switch between them. Jersey is the reference implementation and I chose it for now.

For the client part I'm going to use angularJS+bootstrap (so just html/css/js and no jsp pages).

Just for the record I say that I use PostgreSQL as my DB and EclipseLink as my JPA (ORM).

Here I think I just miss one part and that's the server part (the host for JAX-RS service). AFAIK I can either use a Servlet Container (e.g. Apache tomcat) or a customize server (using NIO framwroks such as Netty and Grizzly, or maybe NIO.2 which is part of JDK 7) for that purpose.

But I don't know which one should I use. I think a pros and cons between this two solution help me choose one.

sajjadG
  • 2,546
  • 2
  • 30
  • 35
  • Well, what is your aim? – Adam Arold Nov 04 '13 at 15:00
  • @AdamArold What should I answer you bro? I want to develop a web application usnign JAX-RS as I said above. I don't have any restriction for now. But later I want to separate my projects as different independent services. I like to design it in SOA way but for now I don't know what should I do. I think RESTful design help to design a SOA app. – sajjadG Nov 04 '13 at 15:04
  • 1
    Use the one you know better, and will be easier for you to support in long term. If for learning, then use both in 2 distinctive implementations. – Egor Margineanu Nov 04 '13 at 15:42

0 Answers0