Services
Understand the concept of services in Apache APISIX, which represent backend applications and reduce configuration redundancy across routes.
Overview
A service object in APISIX is an abstraction of a backend application providing logically related functionalities. The relationship between a service and routes is usually one-to-many (1:N).
The following diagram illustrates an example of a service object used in architecting a data analytics (da) backend at Foodbar Company (a fictional company), where there are two routes with distinctive configurations - one for getting data (HTTP GET) and the other one for uploading data (HTTP POST):
Note that the rate-limiting plugin limit-count is configured once on the service object, regulating incoming client requests from the two routes. Similarly, the upstream address is also configured only once on the upstream object. You can configure plugins and upstreams on each route individually and repetitively to serve the same purpose, but avoid that approach: it becomes hard to manage as the system grows. Upstreams and services reduce the risk of data anomalies and lower operational cost.
The example above points traffic to one upstream node. Add more upstream nodes to enable load balancing and to avoid a single point of failure in the architecture.
Related
Tasks that use this concept
Related concepts