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
Benefits of splitting
Any comments?
Thank you
Alexander
The web server is one of the most important components of a REST API. In this post, you will start your REST API project by creating some initial directories and files. Then you'll create a web server module and wire things up so that the web server starts up and shuts down correctly.
Yes, definitely you can host one website on two different host. But one domain only can run one website at a time. Suppose example.com can use one host at a time to run website. You can select which host.
Putting your web site and database on separate dedicated servers provides much better security and performance.
A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With