Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

standalone vs container REST service

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though the question pertains to REST,it will apply to any service as such.
I have come across fragments of information spread across but never a good design debate.


What advantage do I get publishing the service as a standalone endpoint vs hosting it in a container.
This is more relevant to REST where the primary medium of communication is HTTP,rather than SOAP - thus taking some certificate based QoS convenience out of the picture.

This is a broad question;but would appreciate some insightful opinions and write-ups.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not clear to me what you're asking. Any service will (if implemented in Java) be running on a JVM - are you asking whether that JVM should be used for a servlet container, or for an app server, or just be a one-off solution that runs nothing but your service(s)?

If that's the question then I'd say go with the least amount of work - which is probably a servlet container. Drop in your favorite SOAP/REST framework -which is likely to be a web app anyway-, deploy the service and be done. Rolling your own is way more work.
 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is much more simpler and elementary - sorry if I got this confused.
Why would i decide to make a RESTful service as a stand alone Java app or a web app inside a container.

Particularly for a HTTP based REST,I needed some insights on what I stand to gain or lose if i go either way.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's what I understood the question to be, so my answer applies in full.

Unless you want to roll your own REST framework that doesn't rely on the servlet API, but why would you?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Particularly for a HTTP based REST,I needed some insights on what I stand to gain or lose if i go either way.


The REST concept was originally conceived of as only meaningful for HTTP - see Fielding's original dissertation.

Since you need a HTTP hosting environment the question of a standalone app simply does not arise.

There are plenty of servlet containers besides Tomcat so you have a big spectrum to choose from.

Is this all just speculation or are you actually looking into creating a service?

Bill
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic