Search code examples
javaperformancespringwebrestful-architecture

For performance, Spring webservices or pure restful jersey even if i use MVC?


im using spring MVC and webflow to create a game server and serve some web pages to the users. Thing is, the javascript game will also make multiple ajax calls to restful services on the same server for some game logic. While the web page serving performance is not critical, the restful service calls need to be as efficient as possible (efficient as in response time).

For performance of the services, would it be better to use pure JAX-RS (jersey) web service calls without the spring ws overhead (since i understand the spring layer could affect performances negatively) or would it be the same if i used the spring webservices framework instead and maintain integration with the rest of the spring family?

thanks!


Solution

  • I don't think Spring per se will affect performance negatively. Where did you hear that?

    Spring web services are "contract first" SOAP services. If you're saying that you don't want to pay the overhead of SOAP, XML, marshalling and unmarshalling, then you have a valid point. That's true whether you use Spring to implement the services or not.

    REST is HTTP, so it's a natural for AJAX calls.

    I believe Spring 3.0 supports REST, so it's not a "Spring or not Spring" choice:

    http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/new-in-3.html#d0e1188