RethinkDB

Detailed information on the RethinkDB state store component

Component format

To setup RethinkDB state store, create a component of type state.rethinkdb. See the how-to guide to create and apply a state store configuration.

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: <NAME>
  5. spec:
  6. type: state.rethinkdb
  7. version: v1
  8. metadata:
  9. - name: address
  10. value: <REPLACE-RETHINKDB-ADDRESS> # Required, e.g. 127.0.0.1:28015 or rethinkdb.default.svc.cluster.local:28015).
  11. - name: database
  12. value: <REPLACE-RETHINKDB-DB-NAME> # Required, e.g. dapr (alpha-numerics only)
  13. - name: table
  14. value: # Optional
  15. - name: username
  16. value: <USERNAME> # Optional
  17. - name: password
  18. value: <PASSWORD> # Optional
  19. - name: archive
  20. value: bool # Optional (whether or not store should keep archive table of all the state changes)

Warning

The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets, as described here.

If the optional archive metadata is set to true, on each state change, the RethinkDB state store will also log state changes with timestamp in the daprstate_archive table. This allows for time series analyses of the state managed by Dapr.

Spec metadata fields

FieldRequiredDetailsExample
addressYThe address for RethinkDB server“127.0.0.1:28015”, “rethinkdb.default.svc.cluster.local:28015”
databaseYThe database to use. Alpha-numerics only“dapr”
tableNThe table name to use“table”
usernameNThe username to connect with“user”
passwordNThe password to connect with“password”
archiveNWhether or not to archive the table“true”, “false”

Setup RethinkDB

You can run RethinkDB locally using Docker:

  1. docker run --name rethinkdb -v "$PWD:/rethinkdb-data" -d rethinkdb:latest

To connect to the admin UI:

  1. open "http://$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' rethinkdb):8080"

Last modified August 26, 2022: RethinkDB now Beta, but has no transactions, etags (c3c0aa83)