Consumer Groups enable the organization and categorization of Consumers (users or applications) within an API ecosystem. By grouping Consumers together, you eliminate the need to manage them individually, providing a scalable, efficient approach to managing configurations.
With Consumer Groups, you can scope plugins to specifically defined Consumer Groups and a new plugin instance will be created for each individual Consumer Group, making configurations and customizations more flexible and convenient. For all plugins available on the consumer groups scope, see the Plugin scopes reference.
For example, you could define two groups, Gold and Silver, assign different rate limits to them, then process each group using a different plugin:
flowchart LR A((fa:fa-user Consumers 1-5)) B(Consumer Group Gold fa:fa-user Consumer 1, fa:fa-user Consumer 2, fa:fa-user Consumer 5 ) C(Consumer Group Silver fa:fa-user Consumer 3, fa:fa-user Consumer 4) D(Rate Limiting Advanced 10 requests/second) E(Rate Limiting Advanced 2 requests/second) F(Gateway Service QR Code Generation) H(QR Code Generation service) A--> B & C subgraph id1 [Kong Gateway] direction LR B --> D --> F C --> E --> F end F --> H
Without Consumer Groups, you would have to use five Rate Limiting Advanced plugins, once for each consumer. Any time you change the rate limit, you would need to update every consumer individually.
Consumer Groups allow you to manage your plugin configuration centrally, and reduce the size of your Kong Gateway configuration at the same time. In this example, it’s the difference between using two plugins or five plugins. In your production environment, it could be the difference between two plugins and five million plugins.