keycloak-scim/topics/cache.adoc

19 lines
1.5 KiB
Text
Raw Normal View History

2016-04-30 04:39:32 +00:00
2016-04-28 23:31:06 +00:00
== Server Cache Configuration
2016-04-18 19:28:19 +00:00
2016-04-28 23:31:06 +00:00
{{book.project.name}} has two types of caches. One type of cache sits in front of the database to decrease load on the DB
2016-04-29 20:12:12 +00:00
and to increase overall response times by keeping data in memory. Realm, client, role, and user metadata is kept in this type of cache.
2016-11-16 21:59:48 +00:00
This cache is a local cache. Local caches do not use replication even if you are in the cluster with more {{book.project.name}} servers.
2016-04-28 23:31:06 +00:00
Instead, they only keep copies locally and if the entry is updated an invalidation message is sent to the rest of the cluster
2016-11-16 21:59:48 +00:00
and the entry is evicted. There is separate replicated cache `work`, which task is to send the invalidation messages to the whole cluster about what entries
should be evicted from local caches. This greatly reduces network traffic, makes things efficient, and avoids transmitting sensitive
metadata over the wire.
2016-04-18 19:28:19 +00:00
2016-04-28 23:31:06 +00:00
The second type of cache handles managing user sessions, offline tokens, and keeping track of login failures so that the
server can detect password phishing and other attacks. The data held in these caches is temporary, in memory only,
but is possibly replicated across the cluster.
2016-04-18 19:28:19 +00:00
2016-04-28 23:31:06 +00:00
This chapter discusses some configuration options for these caches for both clustered a non-clustered deployments.
2016-04-18 19:28:19 +00:00
NOTE: More advanced configuration of these caches can be found in link:{{book.appserver.doc_base_url}}{{book.appserver.version}}{{book.appserver.caching_ref.link}}[{{book.appserver.caching_ref.name}}] in the _{{book.appserver.admindoc.name}}_.