Building an API platform on AWSPlan2 min

Protocol selection

As you start planning the API, you will need to pick an appropriate protocol for the API based on the workload characteristics. API Gateway supports RESTful (REST and HTTP) and WebSocket APIs.

API Gateway creates RESTful APIs that:

  • Are HTTP-based.
  • Enable stateless client-server communication.
  • Implement standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE.

API Gateway creates WebSocket APIs that:

  • Adhere to the WebSocket protocol, which enables stateful, full-duplex communication between client and server.
  • Route incoming messages based on message content.

API Protocols

Endpoint type selection

Next, select the endpoint type for the API based on the origin of API traffic.

Edge-optimized: Best for geographically distributed clients. API requests are routed to the nearest CloudFront Point of Presence (POP).

Regional: Intended for clients in the same region. When a client running on an EC2 instance calls an API in the same region, or when an API should serve a small number of clients with high demands, a regional API reduces the connection overhead.

Private: Endpoint that can only be accessed from your Amazon Virtual Private Cloud (VPC) using an interface VPC endpoint.

Note: You can change endpoint type later if necessary.

API topology

In settings with a large number of APIs, you must also choose API topology based on consumption patterns and needs such as tenant isolation in SaaS implementations. The common topologies are centralized and distributed APIs:

API topology

Each of the topologies have their own advantages and disadvantages. Centralized APIs allow for the simpler API branding and centralized governance, security, and observability. Distributed APIs are easier to implement as they do not require access to the shared resources accounts.

Note: See documentation articles on API mappings and routing rules for more details on how to implement centralized APIs


Created by:

Arthi Jaganathan
Arthi JaganathanArthi is a Principal Serverless Solutions Architect who works closely with customers in ASEAN. She is passionate about Serverless and developer tooling.
Giedrius Praspaliauskas
Giedrius PraspaliauskasGiedrius is a senior solutions architect focusing on serverless at Amazon Web Services based in the US.