One Web API calls the other Web APIs

205 views Asked by At

I have 3 Web API Servers which have the same functionality. I am going to add another Web API server which will be used only for Proxy. So All clients from anywhere and any devices will call Web API Proxy server and the Proxy server will transfer randomly the client requests to the other 3 Web API servers. I am doing this way because:

  • There are a lot of client requests in a minute and I can not use only 1 Web API server.
  • If one server was dead, clients can still send request to the other servers. (I need at least 1 web servers response to the clients )

The Question is:

  • What is the best way to implement the Web API Proxy server?

  • Is there a better way to handle high volume client requests?

I need at least 1 web server response to the clients. If I have 3 servers and 2 of them are dead.

Please give me some links or documents that can help me.

Thanks

2

There are 2 answers

3
pillingworth On

Sounds like you need a reverse proxy. Apache HTTP Server and NGINX can be configured to act as a load balanced reverse proxy.

NGINX documentation: http://nginx.com/resources/admin-guide/reverse-proxy/

Apache HTTP Server documentation: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

0
masimplo On

What you are describing is call Load Balancing and Azure (which seems you are using from your comments) provides it out of the box both for Cloud Services and Websites. You should create as many instances as you like under the same cloud service and open a specific port (which will be load balanced) under cloud service endpoints.