Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 2.42 KB

patterns.md

File metadata and controls

15 lines (11 loc) · 2.42 KB

Patterns

There are many common patterns in use across the API sector, but the foundation of the modern API toolbox continues to be REST. with GraphQL, WebSockets, and increasingly gRPC added to the mix. The line between pattern and protocol is often a blurry one, but there are a handful of well-known patterns that act as the cornerstone for API applications and integrations, depending on which industry or layer of the enterprise an API is operating in. While there are other patterns to consider, these five API matter the most to enterprise organizations today.

Patterns

  • REST - Representational state transfer is a software architectural style created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of a distributed system should behave.
  • GraphQL - GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API. It gives clients the power to ask for exactly what they need and nothing more.
  • WebSockets - WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and is used heavily for financial APIs.
  • gRPC - gRPC, also known as Google Remote Procedure Call, is an open- source remote procedure call system initially developed at Google in 2015 as the next generation of the RPC infrastructure. It has since become a desired patent used internally with HTTP/2.
  • Microservices - A microservice architecture–a variant of the service-oriented architecture structural style–arranges an application as a collection of loosely- coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight.
  • Webhooks - Webhooks use APIs to trigger events. Instead of making calls to APIs, webhooks occur when different events occur across operations, pinging other systems or sending data to help make actions more event-driven and real-time. With simple web APIs.

Some of these patterns merely provide a style to follow. Others are standardized formats and protocols that provide a set of agreed-upon constraints. You can apply a specific protocol or a mix of transport protocols to consumers, brokers, and other stakeholders.