Skip to main content

Configuring Caching and Queueing

The technologies the DCS uses for caching and communications can be changed through configuration.

The DCS has the following configurable components.

ComponentNotesDefaultExamples of Alternatives
CacheCaches the values of lookups and traces.RedisSQL Server
QueueSends requests to the backend (via dapr)RabbitMQAzure Service Bus
PubsubSends messages to subscribers (via dapr)RabbitMQAzure Service Bus
Redis
StateStores state. Used for results, binary data storage and roadnetmanager state (via dapr)RedisAzure Storage

These pages describe how to configure them for development. For production see the Deployment Guide and the TS.Comms wiki

To use real (as opposed to emulated) azure resources you must configure secrets

Configuring PubSub and Queueing

  • [Configuring PubSub and Queueing via Azure Service Bus](configuring-pubsub-and -queueing-via-azure-service-bus.md)

Configuring State Storage

Configuring Cache

The DCS requires a configured cache for traces and distances.

We currently support caching with either Redis (the default) or SQL Serer.

Both implementations are based on IDistributedCache

The cache type is controlled by the CacheType setting in dev\docker-compose\.env

By default the cache type is set to Redis. If you want to use SQL Server see the link below.

Optional: Removing Redis

If you switch the state to using Azure Storage and the Cache to using SQL Server you can remove the Redis dependency from your image:

  • Delete dev\dapr\components\state.yml
  • Delete the services:redis section in dev\docker-compose\docker-compose.yml
  • Delete the redis dependency from the x-services:dapr-service:depends_on section in dev\docker-compose\docker-compose.yml
  • Delete the redis entry from the volumes section in dev\docker-compose\docker-compose.yml