docs/howto/setup-state-store
Aman Bhardwaj 8e8ba51e4e
Updating state api usage for multi state store changes, (#342)
2020-02-10 16:50:08 -08:00
..
README.md add cloudstate how-to (#339) 2020-02-10 15:01:17 -08:00
setup-aerospike.md add aerospike state store (#328) 2020-02-06 14:23:00 -08:00
setup-azure-cosmosdb.md Updating state api usage for multi state store changes, (#342) 2020-02-10 16:50:08 -08:00
setup-azure-tablestorage.md Add Azure Table storage to the list of store providers (#323) 2020-02-05 15:51:27 -08:00
setup-cassandra.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
setup-cloudstate.md add cloudstate description (#340) 2020-02-10 15:07:19 -08:00
setup-consul.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
setup-couchbase.md add couchbase how-to (#331) 2020-02-07 14:01:32 -08:00
setup-etcd.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
setup-firestore.md Add GCP Firestore How To (#238) 2019-11-11 10:55:19 -08:00
setup-hazelcast.md add hazelcast docs (#329) 2020-02-06 17:01:38 -08:00
setup-memcached.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
setup-mongodb.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
setup-redis.md updated to reflect helm 3 syntax (#291) 2020-01-09 16:03:58 -08:00
setup-sqlserver.md Add SQL Server state store documentation (#289) 2020-01-08 15:29:47 -08:00
setup-zookeeper.md Migrate from helm 2 to helm 3 (#307) 2020-01-31 16:11:06 -08:00
supported-state-stores.md add cloudstate how-to (#339) 2020-02-10 15:01:17 -08:00

README.md

Setup a Dapr state store

Dapr integrates with existing databases to provide apps with state management capabilities for CRUD operations, transactions and more. Currently, Dapr supports the configuration of one state store per cluster.

State stores are extensible and can be found in the components-contrib repo.

A state store in Dapr is described using a Component file:

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: statestore
spec:
  type: state.<DATABASE>
  metadata:
  - name: <KEY>
    value: <VALUE>
  - name: <KEY>
    value: <VALUE>
...

The type of database is determined by the type field, and things like connection strings and other metadata are put in the .metadata section. Even though you can put plain text secrets in there, it is recommended you use a secret store.

Running locally

When running locally with the Dapr CLI, a component file for a Redis state store will be automatically created in a components directory in your current working directory.

You can make changes to this file the way you see fit, whether to change connection values or replace it with a different store.

Running in Kubernetes

Dapr uses a Kubernetes Operator to update the sidecars running in the cluster with different components. To setup a state store in Kubernetes, use kubectl to apply the component file:

kubectl apply -f statestore.yaml

Reference