docs/howto/setup-state-store
Sivamuthu Kumar f5610795c3
Setup Azure Blob Storage Docs (#714)
* Setup Azure Blob Storage Docs

* Add link in read me of how to setup state store
2020-07-29 19:28:42 -07:00
..
README.md Setup Azure Blob Storage Docs (#714) 2020-07-29 19:28:42 -07:00
setup-aerospike.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-azure-blobstorage.md Setup Azure Blob Storage Docs (#714) 2020-07-29 19:28:42 -07:00
setup-azure-cosmosdb.md Cosmos - data must be in json (#691) 2020-07-14 20:09:13 -07:00
setup-azure-tablestorage.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-cassandra.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-cloudstate.md namespace in all yaml samples 2020-05-02 04:04:13 -07:00
setup-consul.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-couchbase.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-etcd.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-firestore.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-hazelcast.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-memcached.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-mongodb.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-postgresql.md Update setup-postgresql.md (#696) 2020-07-22 08:47:20 -07:00
setup-redis.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-sqlserver.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
setup-zookeeper.md add components-path references (#626) 2020-06-04 16:40:14 -07:00
supported-state-stores.md Setup Azure Blob Storage Docs (#714) 2020-07-29 19:28:42 -07: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
  namespace: default
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