--- description: |- Consul is a highly available and distributed service discovery and KV store designed with support for the modern data center to make distributed systems and configuration easy. ---
Feature rich key/value store lets you easily configure services.
Download Explore DocsServices have many runtime configurations, such as feature flags or maintenance modes, that need to be propagated in real time. Distributing these updates using configuration management or by re-deploying services can take minutes to hours. During these rollout periods, infrastructure can be out of sync and service configurations could be incorrect.
Consul can update service configurations across thousands of services in a globally distributed fleet in real time. Configuration can be stored in a hierarchical key/value store, and efficient edge triggers allow changes to be pushed to applications quickly.
Feature rich key/value store for dynamic service configuration data. Use it for feature flagging, maintenance modes, and more.
The key/value store supports both read and write transactions. This allows multiple keys to be updated or read as an atomic transaction. Changes to service configuration can be done atomically to minimize churn and avoid inconsistencies.
$ curl \
--request POST \
--data \
'{
"Name": "api",
"Service": {
"Service": "api",
"Tags"
: ["v1.2.3"],
"Failover": {
"Datacenters": ["dc1", "dc2"]
The Consul API supports blocking queries, allowing edge triggered updates. Clients use this to get notified immediately of any changes. Tools like consul-template allow configuration files to be rendered in real-time to third-party sources when any configuration changes are made.
$ curl \
--request POST \
--data \
'{
"Name": "api",
"Service": {
"Service": "api",
"Tags": ["v1.2.3"],
"Failover": {
"Datacenters": ["dc1", "dc2"]
Watches use blocking queries monitor for any configuration or health status updates and invoke user specified scripts to handle changes. This makes it easy to build reactive infrastructure.
$ curl \
--request POST \
--data \
'{
"Name": "api",
"Service": {
"Service": "api",
"Tags": ["v1.2.3"],
"Failover": {
"Datacenters": ["dc1", "dc2"]
The key/value store supports distributed locks and semaphores. This makes it easier for applications to perform leader election or manage access to shared resources.