dapr / proposals

Proposals for new features in Dapr
Apache License 2.0
15 stars 33 forks source link

Add state store cache proposal - first draft #7

Open berndverst opened 1 year ago

berndverst commented 1 year ago

Signed-off-by: Bernd Verst 4535280+berndverst@users.noreply.github.com

This is a proposal for using existing state stores with TTL feature as a cache layer for all state stores.

For example Redis Cache or In Memory state store could be used as caches for any other state store (e.g. Azure Cosmos DB)

ItalyPaleAle commented 1 year ago

I think this is a valid proposal, but wondering if we can make the API generic so that they can be used as a general-purpose cache too? Just like secret stores, which can be used as general purpose secret stores and for storing component secrets.

I also would recommend two more changes in components:

omidb commented 1 year ago

Dapr sidecar has access to the lifecycle of a service (grpc (proxy) or http) and on each invoke we can cache the results for that specific request. This way we get a consistent cache for the service. We can invalidate the cache as soon as sidecar is restarted.

berndverst commented 1 year ago

Someone else please continue this proposal as I will not be active on it.