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.

Using spring mvc to create a restful api, Maven is build tool and tomcat with spring jars is deployment .

Plan A: each webservice will be its own separate war file/project ? if required I would supply dependices as jar(s) (such as any dao's/dto's/service layer classes used in different webservices? I would share the spring jars between projects from with tomcat lib directory.

Plan B: Have one large project with different controllers (and subsequent request mappings for restful api) added when needed. Supply the spring dependices with project in maven.

Which is better ? I'm aware spring is not jax-rs compliant - what does this mean in practice, whats the difference if not compliant ?

share|improve this question

migrated from codereview.stackexchange.com May 6 '12 at 17:05

This question came from our site for peer programmer code reviews.

add comment

2 Answers

up vote 1 down vote accepted

It depends on how you want these web services to scale. For example, if your 4 GET calls are called 1 million more times per day than the 1 PUT request, then you'll want to split them out so you can load balance them more easily.

share|improve this answer
add comment

The first option is good if you might deploy to different boxes in the future, for example on a high traffic site you may want each API in a separate machine or cluster. Otherwise it's just a pain so for small projects just put it all in one war file.

share|improve this answer
    
why is it a pain ? –  NimChimpsky May 6 '12 at 18:17
    
its just extra setup and complexity for nothing. You'd be creating a multi-pom project with dependencies between the projects. But all the jars and wars would ultimately deploy on one tomcat box. So it makes more sense to deploy as a single war unless there's a compelling reason to split it up (e.g. the endpoints are going to deploy to different boxes). –  Kevin May 6 '12 at 23:22
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.