Services and Routes
Services and Routes are the fundamental building blocks for traffic routing in API7 Gateway. Together, they define how the gateway matches incoming requests and where it proxies them.
Service
A Service is a logical grouping of routes that share common backend (Upstream) and plugin configurations. In a microservices architecture, a Service typically represents a single business capability or microservice (e.g., "User Service" or "Payment Service").
Key fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name for the service. Max 100 characters. |
type | string | No | http (default) or stream. |
hosts | array | No | List of domain names the service accepts. Max 32 items. |
path_prefix | string | No | The listening path prefix. Must start with /. |
strip_path_prefix | boolean | No | If true (default), the path_prefix is removed before proxying to the upstream. |
upstream | object | No | Backend target configuration. |
plugins | object | No | Plugins applied to all routes in this service. |
Route
A Route defines specific matching rules (URI, HTTP method, host) for incoming requests within a Service. When a request matches a Route, the gateway applies the defined policies and proxies the request to the Service's Upstream.
Key fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name for the route. |
paths | array | Yes | List of URL paths (after path_prefix) to match. Max 64 items. Each must start with /. |
methods | array | No | Allowed HTTP methods (e.g., GET, POST). If empty, all methods are allowed. |
vars | array | No | Advanced matching rules using API7 Expressions. |
priority | integer | No | Matching priority. Higher values win. Default is 0. |
enable_websocket | boolean | No | Enables WebSocket proxying for the route. |
plugins | object | No | Plugins specific to this route. |
Request flow
The following diagram shows how a request flows through Routes and Services to the backend:
Enterprise vs. open source workflow
In API7 Enterprise, the Control Plane stores gateway configuration and syncs it to the relevant Data Plane nodes. This provides centralized management, auditability, and environment isolation without a separate release workflow.
| Feature | Open Source APISIX | API7 Enterprise |
|---|---|---|
| Persistence | Immediate update to Data Plane (via etcd). | Stored in the Control Plane database and synced to Data Plane nodes. |
| Configuration scope | Configuration is managed directly against the APISIX cluster. | Configuration is scoped by Gateway Group and managed through the Control Plane. |
| Deployment | Changes take effect as soon as they are saved. | Changes are synced from the Control Plane to the Data Plane nodes in the target Gateway Group. |
| Audit | Minimal change tracking. | Full audit logs for Control Plane operations. |