Enabling clustering
Most of the time, you will be running a Keycloak cluster when going to production. To respect some key non-functional aspects, as well as the Service-Level Agreements (SLAs) defined for your services, enabling clustering is crucial.
In terms of availability, clustering allows you to run multiple Keycloak instances, possibly in different availability zones, so that uptime is not impacted if nodes (or availability zones) go down.
From a scalability perspective, clustering allows you to scale your nodes up and down according to the load on your system, helping to keep a consistent response time and throughput.
In terms of failover, a cluster helps you to recover and survive from failures, therefore preventing data loss (mainly that kept in caches) as well as avoiding impacts on general availability.
Keycloak is designed for high availability and fast response times, where, in addition to the persistent data kept in the database, it also uses a cache...