Service
The relationship between Routes and a Service is usually N:1 as shown in the image below.
As shown, different Routes could be bound to the same Service. This reduces redundancy as these bounded Routes will have the same and Plugin configurations.
Examples
We can also specify different Plugins or Upstream for the Routes than the ones defined in the Service. The example below creates a Route with a limit-count Plugin. This Route will continue to use the other configurations defined in the Service (here, the Upstream configuration).
curl http://127.0.0.1:9080/apisix/admin/routes/102 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"service_id": "200",
"plugins": {
"limit-count": {
"count": 2000,
"rejected_code": 503,
"key": "remote_addr"
}
}