How can I do Geolocation based routing to Different Back-end Servers?

Not applicable

Say I have 2 back-end services one deployed in Europe and one in the United States.

How would I go about configuring Apigee to route to the one physically closest to the client?

I have looked at http://apigee.com/docs/api-services/content/load-balancing-across-backend-servers and there are routing algorithms for round-robin, weighted and least used. Is there an algorithm for location based routing? Or is there another way to do this?

Note : we are already have an Apigee Edge multi-region deployment.

0 4 2,265
4 REPLIES 4

Hi @reidym,

This article might be useful in your case. Please respond here if you need further information.

Thanks!

@Alex Toombs thank you for the answer, but what you have suggested is to route the request from where the proxy is sitting to the closest back end. But what if we want to do geolocaiton routing based on original client request or we want to monetise and bill different geolocation differently ? I tried to use the client variable, it dosent show country and locality, but it does show client ip address.

9165-capture.png

Not applicable

@Alex Toombs , Nice Article .

In addition to routing , there could be cases where some functionality can be specific to a region like

1) Spike arrest and concurrent rate limit values could be different . 2) You may need to LB to different number of target servers in each region . 3) In case of regions more than 2 , code doesn't look good if you use if---else to chose the region .

In scenarios like above , we can maintain different target endpoint definitions completely for each region and using the "system.region.name" itself in the Routerule , we can route to respective region target endpoint def .

You will be reusing the same policies across the target definitions , its just that a new definition with any region specific logic .

PS: I have seen few customers with all above 3 requirements .

We are using the above approach and getting region name as dc-1 and dc-2. Our production guys are not sure dc-1 corresponds to which data center and similarly for dc-2. Is there any config file we can look up to find out. I mean login to a machine in data center and look up any config file to find what name is provisioned for region name(system.region.name).

here is the new question url:
https://community.apigee.com/questions/58989/load-balancing-based-on-systemregionname.html