views:

157

answers:

3

I have a web application that consists of Website and REST API. Should I host them on the same server or should I host them on different servers? By "server" I mean a server cluster - several servers behind load balancer.

API is mostly inbound traffic, website - mostly outbound.

If it matters - hosted on Rackspace and/or AWS.

Here is what I see so far:

Benefits of having Website and REST API on the same server

  • Simple deployment
  • Simple scaling - something is slow - just launch another instance
  • Single load balancer configuration
  • Simple monitoring
  • Simple, simple, simple ...
  • Effective use of full duplex network (API - inbound, website - outbound)

Benefits of splitting

  • API overload will not affect website load time
  • Detailed monitoring (I will know which component uses resources at this moment)

Any comments?

Thank you

Alexander

+1  A: 

Just as you stated, in most situations, there are more advantages in hosting the API on the same server as the website. So I would stick with that option.

But if you predict allot of traffic for either the website or the API, then maybe a separate server would be more suited.

rogeriopvl
A: 

If this is on a load balancer why don't you leave the services and pages on the same site and let the load balancer/cluster do its job?

Matthew Whited
A: 

Your list of advantages/disadvantages are operational considerations, but you should consider application needs as well.

  • Caching?
  • Security?
  • Other resources, i.e. filesystem

These may or may not apply, but if your application architecture is different between the two, be sure to factor this into your decision.

jro