top of page

Making your APIs highly available

Making your APIs highly available


Creating great APIs require planning and consideration with the customer in mind. When creating API proxies you should begin with the end in mind. In Apigee proxies allow you to expose your business logic. Proxies allow you to do things like attach policies. These proxies sit between your customer and your backend. Proxies are made up of 2 different endpoint types: 


Proxy endpoint - Defines how customers will access your APIs. 

Target endpoints - Defines how customers will interact with your backend applications by decoupling hard coded endpoint URLs from TargetEndpoint configurations.


One of the ways you can deliver a great experience to your customer is by making your API highly available. There may be times where you have separate load balancers pointing to your backend server in order to provide high availability. You can leverage these load balancers to make your backend highly available by using the target endpoint to configure load balancing.


Target servers

In order to set up load balancing within your proxy, you have to first create a target server. Target servers allows you to give each of your backend servers a unique name that is coupled to a host or a server. This unique name can be used to configure “targets” in your target endpoint configuration. In order to create a target server you can log into the Apigee console go to Management > Environments:





Target servers live in environments. In order for your target servers to be available for your proxy they have to be created in the environment that your proxy is deployed to. 

Next click on Target Servers > Create target server:





After putting in all of your server information click on create.




After creating your target servers, Next edit your target endpoint configuration by going to proxy > Develop > target endpoint. 





Distributing the load

When you configure a load balancer in your proxy by default Apigee will use the round robin algorithm to distribute your traffic which will send traffic to each server in the order listed. You can also choose between:


  • Weighted: Allows you to define what percentage of traffic goes to what server.

  • Least connection: Sends requests to the TargetServer with fewest open HTTP connections.


These algorithms can be declared using the <algorithm> option.


<LoadBalancer>

        <Algorithm>RoundRobin</Algorithm>


In addition to using algorithms you can also configure routing logic based on failures using the MaximumFailures and the Retry options. You can also configure things like health checks and fallbacks.


Conclusion 

Configuring target servers in your target endpoint configuration allows you to create great digital experiences for your customers by making your API highly available. APIs that are reliable and easy to use will help increase adoption across your organization and customer base. Want to know more about target servers and the additional features that you can configure to make them more robust checkout this Apigee training




Recent Posts

See All

APIs are products too

Often times when we think of software products we think of traditional software applications or digital platforms that a customer will...

Leveraging mock targets in Apigee

In Apigee the proxy is a mechanism that sits between your client and the target (backend). Proxies help decouple your API from your...

Comments


bottom of page