Cluster Configuration
This section will help to understand what you need for setting up a Cadence cluster.
You should understand some basic static configuration of Cadence cluster.
There are also many other configuration called "Dynamic Configuration" for fine tuning the cluster. The default values are good to go for small clusters.
Cadence’s minimum dependency is a database(Cassandra or SQL based like MySQL/Postgres). Cadence uses it for persistence. All instances of Cadence clusters are stateless.
For production you also need a metric server(Prometheus/Statsd/M3/etc).
For advanced features Cadence depends on others like Elastisearch/OpenSearch+Kafka if you need Advanced visibility feature to search workflows. Cadence will depends on a blob store like S3 if you need to enable archival feature.
Static configuration
Configuration Directory and Files
The default directory for configuration files is named config/. This directory contains various configuration files, but not all files will necessarily be used in every scenario.
Combining Configuration Files
- Base Configuration: The
base.yamlfile is always loaded first, providing a common configuration that applies to all environments. - Runtime Environment File: The second file to be loaded is specific to the runtime environment. The environment name can be specified through the
$CADENCE_ENVIRONMENTenvironment variable or passed as a command-line argument. If neither option is specified,development.yamlis used by default. - Availability Zone File: If an availability zone is specified (either through the
$CADENCE_AVAILABILITY_ZONEenvironment variable or as a command-line argument), a file named after the zone will be merged. For example, if you specify "az1" as the zone,production_az1.yamlwill be used as well.
To merge base.yaml, production.yaml, and production_az1.yaml files, you need to specify "production" as the runtime environment and "az1" as the zone.
// base.yaml -> production.yaml -> production_az1.yaml = final configuration
Using Environment Variables
Configuration values can be provided using environment variables with a specific syntax.
$VAR: This notation will be replaced with the value of the specified environment variable. If the environment variable is not set, the value will be left blank.
You can declare a default value using the syntax {$VAR:default}. This means that if the environment variable VAR is not set, the default value will be used instead.
Note: If you want to include the $ symbol literally in your configuration file (without interpreting it as an environment variable substitution), escape it by using $$. This will prevent it from being replaced by an environment variable value.