Service architecture

Updated at:
Copy as MD

API Gateway consists of two main components: GW Controller and Mosng. The GW Controller pushes data to Mosng, which then provides external services. This topic describes the components of the API Gateway architecture.

API Gateway consists of the following components:

  • GW Controller: The gateway console that provides a user interface for gateway operations.

  • Mosng: The core service component that provides core Remote Procedure Call (RPC) capabilities.

Product architecture

The traffic path for API Gateway is as follows:

  • API configuration

    1. A user configures API information in the API Gateway console.

    2. The GW Controller saves the configuration to the database and uses ZK/DRM to notify other API Gateway containers.

    3. The GW Controller pushes the updated API information to the Mosng memory over gRPC.

  • API service invocation

    1. An application sends a request to the gateway using a protocol such as HTTP, SOFARPC, or SOFAREST.

    2. Mosng validates the application request based on the API information in its memory. This process includes signature verification, decryption, and RPC information validation.

      • If the validation fails, the gateway immediately returns an error message to the application.

      • If the validation passes, the gateway forwards the request to the backend service using the configured protocol, such as HTTP, SOFARPC, or SOFAREST.