From 255dd06c92960b348043184afde52fbe4d69b8c4 Mon Sep 17 00:00:00 2001 From: mmattel Date: Mon, 3 Apr 2023 19:15:33 +0200 Subject: [PATCH] [docs-only] Fix readme.md for caches --- services/eventhistory/README.md | 4 +++- services/gateway/README.md | 14 ++++++++++++++ services/gateway/pkg/config/config.go | 2 +- services/graph/README.md | 18 +++++++++++++++++- services/ocs/README.md | 19 +++++++++++++++++++ services/proxy/README.md | 16 ++++++++++++++++ services/userlog/README.md | 3 ++- 7 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 services/gateway/README.md create mode 100644 services/ocs/README.md diff --git a/services/eventhistory/README.md b/services/eventhistory/README.md index 08dc452737..8223561952 100644 --- a/services/eventhistory/README.md +++ b/services/eventhistory/README.md @@ -13,9 +13,10 @@ The `eventhistory` services consumes all events from the configured event sytem. ## Storing The `eventhistory` service stores each consumed event via the configured store in `EVENTHISTORY_STORE_TYPE`. Possible stores are: - - `mem`: Basic in-memory store and the default. + - `memory`: Basic in-memory store and the default. - `ocmem`: Advanced in-memory store allowing max size. - `redis`: Stores data in a configured redis cluster. + - `redis-sentinel`: Stores data in a configured redis sentinel cluster. - `etcd`: Stores data in a configured etcd cluster. - `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store) - `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. @@ -24,6 +25,7 @@ The `eventhistory` service stores each consumed event via the configured store i 2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicapable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store applies. 3. Events stay in the store for 2 weeks by default. Use `EVENTHISTORY_RECORD_EXPIRY` to adjust this value. 4. The eventhistory service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances. +5. When using `redis-sentinel`, the Redis master to use is configured via `EVENTHISTORY_STORE_ADDRESSES` in the form of `:/` like `10.10.0.200:26379/mymaster`. ## Retrieving diff --git a/services/gateway/README.md b/services/gateway/README.md new file mode 100644 index 0000000000..8d69fa39d7 --- /dev/null +++ b/services/gateway/README.md @@ -0,0 +1,14 @@ +# Gateway Service + +The gateway service is an ... + +## Caching + +The `gateway` service can use a configured store via `GATEWAY_CACHE_STORE`. Possible stores are: + - `memory`: Basic in-memory store and the default. + - `redis`: Stores data in a configured redis cluster. + - `etcd`: Stores data in a configured etcd cluster. + +1. Note that in-memory stores are by nature not reboot persistent. +2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicapable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store applies. +3. The proxy service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances. diff --git a/services/gateway/pkg/config/config.go b/services/gateway/pkg/config/config.go index ef0a9fb8b8..c872bbb314 100644 --- a/services/gateway/pkg/config/config.go +++ b/services/gateway/pkg/config/config.go @@ -88,7 +88,7 @@ type StorageRegistry struct { // Cache holds cache config type Cache struct { - Store string `yaml:"store" env:"OCIS_CACHE_STORE;GATEWAY_CACHE_STORE;OCIS_CACHE_STORE_TYPE;GATEWAY_CACHE_STORE_TYPE" desc:"Store implementation for the cache. Valid values are \"memory\" (default), \"redis\", and \"etcd\"."` + Store string `yaml:"store" env:"OCIS_CACHE_STORE;GATEWAY_CACHE_STORE;OCIS_CACHE_STORE_TYPE;GATEWAY_CACHE_STORE_TYPE" desc:"Store implementation for the cache. Supported values are 'memory' (default), 'redis', and 'etcd'."` Nodes []string `yaml:"nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_CACHE_STORE_NODES;OCIS_CACHE_STORE_ADDRESS;GATEWAY_CACHE_STORE_ADDRESS;GATEWAY_CACHE_NODES" desc:"Nodes to use for the cache store."` Database string `yaml:"database" env:"GATEWAY_CACHE_DATABASE" desc:"Database name of the cache."` StatCacheTTL int `yaml:"stat_cache_ttl" env:"OCIS_CACHE_STORE_TTL;GATEWAY_STAT_CACHE_TTL" desc:"Max TTL in seconds for the gateway's stat cache."` diff --git a/services/graph/README.md b/services/graph/README.md index d910c85e43..87e623e797 100644 --- a/services/graph/README.md +++ b/services/graph/README.md @@ -12,4 +12,20 @@ The following image gives an overview of the scenario when a client requests to - + + +## Caching + +The `graph` service can use a configured store via `GRAPH_STORE_TYPE`. Possible stores are: + - `memory`: Basic in-memory store and the default. + - `ocmem`: Advanced in-memory store allowing max size. + - `redis`: Stores data in a configured redis cluster. + - `redis-sentinel`: Stores data in a configured redis sentinel cluster. + - `etcd`: Stores data in a configured etcd cluster. + - `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store) + - `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. + +1. Note that in-memory stores are by nature not reboot persistent. +2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicapable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store applies. +3. The proxy service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances. +4. When using `redis-sentinel`, the Redis master to use is configured via `GRAPH_CACHE_STORE_NODES` in the form of `:/` like `10.10.0.200:26379/mymaster`. diff --git a/services/ocs/README.md b/services/ocs/README.md new file mode 100644 index 0000000000..4369c17ef5 --- /dev/null +++ b/services/ocs/README.md @@ -0,0 +1,19 @@ +# OCS Service + +The ocs service is an ... + +## Caching + +The `ocs` service can use a configured store via `OCS_STORE_TYPE`. Possible stores are: + - `memory`: Basic in-memory store and the default. + - `ocmem`: Advanced in-memory store allowing max size. + - `redis`: Stores data in a configured redis cluster. + - `redis-sentinel`: Stores data in a configured redis sentinel cluster. + - `etcd`: Stores data in a configured etcd cluster. + - `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store) + - `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. + +1. Note that in-memory stores are by nature not reboot persistent. +2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicapable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store applies. +3. The proxy service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances. +4. When using `redis-sentinel`, the Redis master to use is configured via `OCS_CACHE_STORE_NODES` in the form of `:/` like `10.10.0.200:26379/mymaster`. diff --git a/services/proxy/README.md b/services/proxy/README.md index ed887ff7b2..73db853a1c 100644 --- a/services/proxy/README.md +++ b/services/proxy/README.md @@ -77,3 +77,19 @@ guest: ocisGuest ## Recommendations for Production Deployments In a production deployment, you want to have basic authentication (`PROXY_ENABLE_BASIC_AUTH`) disabled which is the default state. You also want to setup a firewall to only allow requests to the proxy service or the reverse proxy if you have one. Requests to the other services should be blocked by the firewall. + +## Caching + +The `proxy` service can use a configured store via `PROXY_STORE_TYPE`. Possible stores are: + - `memory`: Basic in-memory store and the default. + - `ocmem`: Advanced in-memory store allowing max size. + - `redis`: Stores data in a configured redis cluster. + - `redis-sentinel`: Stores data in a configured redis sentinel cluster. + - `etcd`: Stores data in a configured etcd cluster. + - `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store) + - `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. + +1. Note that in-memory stores are by nature not reboot persistent. +2. Though usually not necessary, a database name and a database table can be configured for event stores if the event store supports this. Generally not applicapable for stores of type `in-memory`. These settings are blank by default which means that the standard settings of the configured store applies. +3. The proxy service can be scaled if not using `in-memory` stores and the stores are configured identically over all instances. +4. When using `redis-sentinel`, the Redis master to use is configured via `PROXY_OIDC_USERINFO_CACHE_NODES` in the form of `:/` like `10.10.0.200:26379/mymaster`. diff --git a/services/userlog/README.md b/services/userlog/README.md index b44fc931aa..b7c5ff758d 100644 --- a/services/userlog/README.md +++ b/services/userlog/README.md @@ -9,9 +9,10 @@ Running the `userlog` service without running the `eventhistory` service is not ## Storing The `userlog` service persists information via the configured store in `USERLOG_STORE_TYPE`. Possible stores are: - - `mem`: Basic in-memory store and the default. + - `memory`: Basic in-memory store and the default. - `ocmem`: Advanced in-memory store allowing max size. - `redis`: Stores data in a configured redis cluster. + - `redis-sentinel`: Stores data in a configured redis sentinel cluster. - `etcd`: Stores data in a configured etcd cluster. - `nats-js`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store) - `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments.