how to create api proxy for multi-tenant web application?

Not applicable

I am able to create an api proxy for a single tenant web application such as http://www.apigeetest.com/web1 ,http://www.apigeetest.com/web2 and http://www.apigeetest.com/web3. But the application I am working on is multi-tenant. The target endpoint will be like http://www.web1.apigeetest.com, http://www.web2.apigeetest.com and http://www.web3.apigeetest.com.

How to create api proxy for such multi-tenant application. If there exist different ways, which one will be the best?

0 2 922
2 REPLIES 2

It sounds like the feature you're looking for is target servers. You could leverage a combination of target servers and route rules to distribute your proxy traffic across multiple backends. Target servers will resolve the domain of your backend at run time.

In your case, it sounds like what you'll need is a single target with multiple target servers setup using a load balancing algorithm. This is generally a 2-step process:

  1. Create the target servers.
  2. Setup the target endpoints with the target servers.

You can read more about how to setup your proxy with target servers here. Also, take a look at this great community tutorial here.

If you need to distribute traffic to different backends based on set a of conditions, you'll want to look into using route rules. You can read more about them here.

@kengilbert If it is going to be an one time set up it is fine. But I am working in a SAAS product. So, in my case, the target endpoints are not exhaustible.

"The target endpoint will be like http://www.web1.apigeetest.com, http://www.web2.apigeetest.com and http://www.web3.apigeetest.com."

Here, apigeetest is my product domain and web1, web2 and web3 are my sub-domains. And more sub-domains will be created in future. And I want to analyse the API usage by each of these clients individually and also as a whole. Is it possible in apigee?