Making your APIs highly available (2024)

Creating reusable APIs require planning and consideration with the customer in mind. Great APIs start with “treating your APIs as products”. This means you start creating APIs with the “end” in mind. In Apigee, proxies allow you to expose your business logic to consumers that you trust. They serve as entry points to application logic and data that sit between your customer and your backend. Proxies also allow you to do things like attach policies. 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.

Making your APIs highly available (2)

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.

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:

Making your APIs highly available (3)

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:

Making your APIs highly available (4)

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

Making your APIs highly available (5)

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

Making your APIs highly available (6)

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.
Making your APIs highly available (7)
  • Least connection: Sends requests to the TargetServer with fewest open HTTP connections.
Making your APIs highly available (8)

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

Making your APIs highly available (9)

In addition to using algorithms you can also configure routing logic based on failures with tools like MaximumFailures, Retry, and Isfallback options within health checks.

Health checks at the proxy level in Apigee allow you to test connectivity to your target servers (backend). By enabling health monitoring you can set up checks to poll the backend service URLs that you specified in your TargetServer configuration. Health checks add a level of fault tolerance to your APIs and allow you to mask failures. Fault tolerance is achieved by monitoring health check requests for failures. After a specified number of failures the load balancer will take the problem target server out of load balancing rotation. Failures are masked because your API is still available by your load balancer sending traffic to your health target servers. Your API consumer is still able to access your APIs without interruption.

When you enable health monitoring there are 2 types of monitor you can specify:

TCPMonitor: TCPMonitors listen on port 80 which by default polls your target servers every 5 seconds.

HTTPMonitor: HTTPMonitor sends a GET request to your target service. You should use HTTPMonitor health checks when your backend is configured to use HTTP and one-way HTTPS protocols.

Handling Failures

Designing highly available APIs require you to consider how failures should be handled. MaximumFailures in Apigee allow you to specify a set number of unsuccessful connections. Once that number of failures have been reached the load balancer will take that specific target server out of rotation. When MaximumFailures attribute is set to 0, the load balancer won’t take the target server out of rotation. It’s important to specify a number of at least 1 in order to take advantage of fault tolerance to reduce interruptions that your consumer may experience. You can specify the maximum number of failures by using the Max Failures element.

Making your APIs highly available (10)

You can also leverage the Retry option to have the health check try to establish connectivity after a failure.

Making your APIs highly available (11)

Using the IsFallback option allows you to set a designated server as the “fall back server” meaning that if all other target servers become unavailable or unhealthy traffic will then be routed to the specified fall back server. You can specify a fallback server by using the Isfallback element.

Making your APIs highly available (12)

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.

Making your APIs highly available (2024)

FAQs

Making your APIs highly available? ›

Adopting a microservices architecture can greatly improve the scalability of your API. By breaking your application into smaller, independent services, each responsible for a specific functionality, you can manage and scale these components individually.

How do I make my APIs more scalable? ›

Adopting a microservices architecture can greatly improve the scalability of your API. By breaking your application into smaller, independent services, each responsible for a specific functionality, you can manage and scale these components individually.

Is API gateway high availability? ›

API Gateway provides an active/active high availability solution for the Admin Node Manager that supports multiple DMZ deployment patterns.

When creating an API, why is it important to consider hosting? ›

The provider then takes care of hosting and managing the API. This includes scaling, monitoring, security, and maintenance. This allows you, as a developer, to focus on developing the functionality of your API. One of the main advantages of API-as-a-service is its simplicity and ease of use.

How do I optimize my API performance? ›

Strategies to Boost Your API Performance
  1. 1 Caching. Caching can improve API performance by storing the results of expensive or frequently accessed operations in a temporary storage area. ...
  2. 2 Connection Pooling. ...
  3. 3 Avoiding M+1 Query Problems. ...
  4. 4 Pagination. ...
  5. 5 Use Lightweight JSON Serializers. ...
  6. 6 Compression. ...
  7. 7 Asynchronous Logging.
Apr 5, 2024

How do I create a high performance API? ›

Step up the API performance
  1. Design and Architecture: Using lightweight data formats like JSON or protocol buffers for faster serialization. ...
  2. Database Optimization: ...
  3. Infrastructure: ...
  4. Code Optimization: ...
  5. API Design, Security and Compliance: ...
  6. Monitoring and Testing: ...
  7. Client-side Optimization.
Feb 14, 2024

What are high level APIs? ›

High-level APIs are fairly abstracted, meaning they are more generic and, therefore limited in functionality. Low-level APIs are much more detailed and specific due to a low level of abstraction. Low-level APIs allow for finer control over application functions.

Why not use API gateway? ›

Downsides of API gateways

It's important to consider these possible API gateway drawbacks: Increased overhead. API gateways add another layer to an application hosting stack, increasing the amount of infrastructure resources required to run apps. Increased complexity.

What is the most used API gateway? ›

The Top 8 API Gateways Include:
  1. Amazon API Gateway.
  2. Azure API Management.
  3. Boomi API Management.
  4. Google API Gateway.
  5. IBM API Connect.
  6. Kong Gateway.
  7. MuleSoft Anypoint Flex Gateway.
  8. WSO2 API Manager.
Jul 8, 2024

What is API-first strategy? ›

API-first, also called the API-first approach, prioritizes APIs at the beginning of the software development process, positioning APIs as the building blocks of software. API-first organizations develop APIs before writing other code, instead of treating them as afterthoughts.

What is the most important in API? ›

The Importance of APIs

With a focus on modern B2B usage, an application programming interface can be a critical component to integrating data flows with customers and partner systems. It can even add increased flexibility to traditional types of robust exchange such as managed file transfer (MFT) and EDI.

Does an API need a server? ›

A Web API or Web Service API is an application processing interface between a web server and web browser. All web services are APIs but not all APIs are web services. REST API is a special type of Web API that uses the standard architectural style explained above.

How do you increase scalability? ›

Strategies like indexing, denormalization, database caching, and query optimisation can facilitate the effective distribution of high-volume data across multiple database instances and avoid unnecessary subqueries, helping you achieve higher scalability and resilience.

What does it mean for an API to be scalable? ›

Scalability is the ability of a system to handle an increasing amount of load while still delivering fast response times. In our definition, a web API delivers a fast response time if it responds in 50 milliseconds or less.

How can I make my API better? ›

7 REST API Best Practices for Designing Robust APIs
  1. Utilize the Recommended Endpoint Naming Conventions.
  2. Use the Appropriate HTTP Method.
  3. Manage REST API Requests and Responses Effectively.
  4. Use the Appropriate Request Headers for Authentication.
  5. Know When to use Parameters vs.
Dec 5, 2023

Top Articles
Podatek od kryptowalut 2024. Jak rozliczyć?
6 ways to avoid ATM fees in Europe
Elleypoint
Star Sessions Imx
Yogabella Babysitter
Winston Salem Nc Craigslist
Dollywood's Smoky Mountain Christmas - Pigeon Forge, TN
Gore Videos Uncensored
Sportsman Warehouse Cda
CHESAPEAKE WV :: Topix, Craigslist Replacement
Paula Deen Italian Cream Cake
Oppenheimer & Co. Inc. Buys Shares of 798,472 AST SpaceMobile, Inc. (NASDAQ:ASTS)
PGA of America leaving Palm Beach Gardens for Frisco, Texas
Housing Intranet Unt
Oxford House Peoria Il
今月のSpotify Japanese Hip Hopベスト作品 -2024/08-|K.EG
How do you like playing as an antagonist? - Goonstation Forums
The fabulous trio of the Miller sisters
Cbs Trade Value Chart Fantasy Football
Bj Alex Mangabuddy
Dtab Customs
How pharmacies can help
Everything you need to know about Costco Travel (and why I love it) - The Points Guy
Mahpeople Com Login
Unforeseen Drama: The Tower of Terror’s Mysterious Closure at Walt Disney World
Reicks View Farms Grain Bids
Acurafinancialservices Com Home Page
Tim Steele Taylorsville Nc
Shia Prayer Times Houston
Insidious 5 Showtimes Near Cinemark Southland Center And Xd
Poe T4 Aisling
Xfinity Outage Map Lacey Wa
Vistatech Quadcopter Drone With Camera Reviews
Pch Sunken Treasures
140000 Kilometers To Miles
How to Play the G Chord on Guitar: A Comprehensive Guide - Breakthrough Guitar | Online Guitar Lessons
What Are Digital Kitchens & How Can They Work for Foodservice
Final Exam Schedule Liberty University
Hisense Ht5021Kp Manual
AI-Powered Free Online Flashcards for Studying | Kahoot!
Toonily The Carry
Why Gas Prices Are So High (Published 2022)
Culvers Lyons Flavor Of The Day
Gopher Hockey Forum
Owa Hilton Email
Cch Staffnet
New Zero Turn Mowers For Sale Near Me
Plasma Donation Greensburg Pa
De boeken van Val McDermid op volgorde
Wvu Workday
Maurices Thanks Crossword Clue
Escape From Tarkov Supply Plans Therapist Quest Guide
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 5917

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.