DevOps.com

AWS BugBust Challenge
  • Latest
    • Articles
    • Features
    • Most Read
    • News
    • News Releases
  • Topics
    • AI
    • Continuous Delivery
    • Continuous Testing
    • Cloud
    • Culture
    • DevSecOps
    • Enterprise DevOps
    • Leadership Suite
    • DevOps Practice
    • ROELBOB
    • DevOps Toolbox
    • IT as Code
  • Videos/Podcasts
    • DevOps Chats
    • DevOps Unbound
  • Webinars
    • Upcoming
    • On-Demand Webinars
  • Library
  • Events
    • Upcoming Events
    • On-Demand Events
  • Sponsored Communities
    • AWS Community Hub
    • CloudBees
    • IT as Code
    • Rocket on DevOps.com
    • Traceable on DevOps.com
    • Quali on DevOps.com
  • Related Sites
    • Techstrong Group
    • Container Journal
    • Security Boulevard
    • Techstrong Research
    • DevOps Chat
    • DevOps Dozen
    • DevOps TV
    • Digital Anarchist
  • Media Kit
  • About
  • AI
  • Cloud
  • Continuous Delivery
  • Continuous Testing
  • DevSecOps
  • Leadership Suite
  • Practices
  • ROELBOB
  • Low-Code/No-Code
  • IT as Code
  • More Topics
    • Application Performance Management/Monitoring
    • Culture
    • Enterprise DevOps

Home » Blogs » When to Use API Management and Service Mesh Together

API CTOs CIOs How to Bring DevOps and Security Teams Closer Together

When to Use API Management and Service Mesh Together

By: Bill Doerrfeld on January 20, 2022 Leave a Comment

Though sometimes described as competing architectures, API management and service mesh have slightly different use cases and can actually work well together. Whereas API management provides the business logic for outside-facing traffic, a service mesh excels at handling intercommunication between microservices. An organization could certainly adopt both simultaneously across their projects. So, when does it make sense to use both API management and service mesh?

I recently chatted with Mark Cheshire, director of product, Red Hat, to discuss the nuances between API management and service mesh. According to Cheshire, API management and service mesh can work quite well side-by-side for particular use cases. For example, a large organization using service mesh could benefit from applying API management that wraps microservices in a usable contract for internal departments. Or, API management could help a company expose specific APIs from the mesh to outside partners.

When to Combine API Management with Service Mesh

Say you already have service mesh—do you need API management, as well? Cheshire offered four questions to keep in mind that may influence your decision.

1. Consider the number of connections and the number of consumers: Is it many-to-one or one-to-many?

Within a monolithic application, communication is more centralized—there is more of a one-to-one relationship. However, when you break apart services into microservices and reuse them across an organization, a service may now have many consumers. This is a good indication you need an API management approach for the interface.

“When environments get larger and larger, you can’t manage that as a flat mesh,” explained Cheshire. “You need some kind of organizational grouping by line-of-business or by the functions that you may have.”

API management can create more formal interfaces between internal groups in a large organization that likely have little to no contact with one another. For example, perhaps the customer data team needs a formal method to connect with the sales organization. Or, maybe a security team supporting a login microservice needs to access financial details from an accounting division.

2. What sort of access control and limiting does the system require?

Consider what access control is necessary to secure your environment and avoid service disruption. A service mesh will typically use a zero-trust approach, applying mutual TLS over every ingress to each microservice. API management can also bring authentication controls and more advanced authorization and traffic mechanics.

API management can provide a streamlined way to apply fine-grained controls for inter-domain traffic that follows the business logic. This helps assign access to specific resources to different requesting parties, such as read-only access for basic users or update access for admins. Amid increasing API attacks, setting fine-grained policies and permissions around your endpoints is becoming increasingly important to avoid data overexposure. This imperative increases as the binary between external and internal traffic fades with more public cloud use, remote work and third-party contractors.

API gateways also place greater emphasis on communication rules and patterns. Rate limiting, for example, is very important to avoid collapsing entire networks, explained Cheshire. In addition to rate limiting, filtering, pagination and content negotiation are also standard API management capabilities that further optimize the exchange between the client and server.

3. Do you require documentation for the services?

In a monolithic setup, you likely have all developers sharing the same repository, explained Cheshire. This may still be true within an internal network of distributed microservices wherein each microservice is independent, yet developers can still access each other’s repositories. When you’re connecting services inside a domain, it’s often just the code itself (and perhaps some in-line commenting) that represents the contract between services.

However, north-south traffic requires much more formalization, he said. Formal contracts are often necessary when one domain is communicating with another within the same company. In this scenario, there’s less tribal knowledge around how things work. API management is useful, in this case, to produce a developer portal with human-readable documentation that explains the methods, request types, URL structures and sample calls. This makes it much easier for someone without preexisting knowledge of the system to integrate with it.

This formal contract is often generated from a specific file, such as OpenAPI Specification, which has emerged as industry-standard metadata for describing REST APIs. Groups can use OpenAPI to automatically generate documentation and even drive specification-first development. All in all, standardizing the way you document APIs and microservices can significantly improve the knowledge-sharing around how services connect.

4. What is the nature of interactions?

Another trait to keep in mind is the nature of interactions between services, Cheshire said. He divided systems into two large types: First is a graph model, in which any service can connect to any service. The second is a hierarchical model in which north-south traffic enables one service to have multiple consumers. A hierarchical model is necessary for productization and SaaS since it creates a single intercept point to the underlying resources. Maintaining hierarchy here is vital to retain simplicity, as you wouldn’t want the consumer to be able to hit all private microservices in a connected graph (unless that’s the intent!).

API management thus enables the sharing of APIs on the mesh. “While they both use communication proxies, and while there are parallels in function, the differences in domain set them apart, and most companies will see significant benefits from using them together,” wrote Dino Chiesa and Greg Kuelgen on the Google Cloud blog.

Better Together

In summary, API management and service mesh go well together. “The two are complementary and can work together,” added William Morgan, CEO, Buoyant. Joaquim Moreno wrote, “they are not mutually exclusive; we should think about them as different layers in your infrastructure.”

Specifically, combining the two is beneficial when:

  • Exposing and productizing APIs on the mesh
  • Formalizing inter-service communication in large corporate networks
  • Applying fine-grained access control; rate limiting for API-based microservices
  • Standardizing services with more formal documentation
  • Interaction is a more hierarchical communication model
  • Providing access to partners
  • When you need to externalize data to third-party plugins or integrations

“The worlds of APIs and services mesh are becoming ever more closely connected,” said Cheshire. And API management won’t stop at REST—as developers adopt new integration styles like Kafka, GraphQL and asynchronous formats, the solutions will evolve. “It’s essentially a governance layer for all your integration points.”

Large companies that seek to standardize inter-domain traffic within organizations will likely benefit from API management. But API management also offers the potential to productize internal infrastructure. Another benefit is that an API management gateway may also monitor and log requests, helping spot actors at the perimeter and keeping a helpful tally of incidents.

Of course, adopting both API management and service mesh may be overkill for some scenarios. And, it’s good to remember that introducing additional layers inherently increases overall latency. It’s up to developers and architects to weigh the options and determine what’s appropriate for their unique environment. To enable this, a healthy culture of open communication is important to ensure teams are on a similar page across divisions, to avoid mismatched adoptions that only increase technical debt.

Recent Posts By Bill Doerrfeld
  • How Are API Management and Service Mesh Different?
  • Trends in Blockchain for 2022
  • Best of 2021 – 11 Open Source DevOps Tools We Love For 2021
More from Bill Doerrfeld
Related Posts
    Related Categories
  • API
  • Blogs
  • Containers
  • DevOps Practice
  • DevOps Toolbox
  • Features
    Related Topics
  • API management
  • distributed applications
  • microservices
  • service mesh
Show more
Show less

Filed Under: API, Blogs, Containers, DevOps Practice, DevOps Toolbox, Features Tagged With: API management, distributed applications, microservices, service mesh

Sponsored Content
Featured eBook
The 101 of Continuous Software Delivery

The 101 of Continuous Software Delivery

Now, more than ever, companies who rapidly react to changing market conditions and customer behavior will have a competitive edge.  Innovation-driven response is successful not only when a company has new ideas, but also when the software needed to implement them is delivered quickly. Companies who have weathered recent events ... Read More
« How to Visit the Metaverse
Securing Software with Intelligent Pipelines »

TechStrong TV – Live

Watch latest episodes and shows

DevOps.com Poll

Get The Top Stories of the Week

  • View DevOps.com Privacy Policy
  • This field is for validation purposes and should be left unchanged.

Upcoming Webinars

The Synchronization of Chaos
Thursday, January 20, 2022 - 1:00 pm EST
Testing in Production With Feature Flags & Continuous Deployment
Thursday, January 20, 2022 - 3:00 pm EST
DevSecOps: Closing the Security Gap With Developers
Friday, January 21, 2022 - 11:00 am EST

Latest from DevOps.com

Securing Software with Intelligent Pipelines
January 20, 2022 | Gunnar Braun
When to Use API Management and Service Mesh Together
January 20, 2022 | Bill Doerrfeld
Zoom-Layoff CEO is Back | Bill Bans Targeted Ads | More FAA 5G Stupidity
January 19, 2022 | Richi Jennings
Drumroll, Please! The Winners of the 2021 DevOps Dozen² Awards Are …
January 19, 2022 | Alan Shimel
Harness CD Platform Now Available via Source-Available License
January 19, 2022 | Mike Vizard

Most Read on DevOps.com

EEEWW—Green iMessage Bubbles | ‘Great Resignation’ Redux | F...
January 13, 2022 | Richi Jennings
2022 Predictions: AI, Security and Cloud
January 13, 2022 | Judith Hurwitz
Low-Code SaaS Solutions Need Security at Their Core
January 14, 2022 | Allen Drennan
Enabling Cloud Adoption in the Government
January 14, 2022 | Brian Price
Innovation With Software Architectural Excellence
January 17, 2022 | Deepak Gupta

On-Demand Webinars

DevOps.com Webinar ReplaysDevOps.com Webinar Replays

Download Free eBook

The State of Open Source Vulnerabilities 2020
The State of Open Source Vulnerabilities 2020
  • Home
  • About DevOps.com
  • Meet our Authors
  • Write for DevOps.com
  • Media Kit
  • Sponsor Info
  • Copyright
  • TOS
  • Privacy Policy

Powered by Techstrong Group, Inc.

© 2022 ·Techstrong Group, Inc.All rights reserved.