In a containerized microservice I'm using the dapr.io state management system as a data cache of equipment; providing a highly efficient way of accessing many equipment status at scale.
Using a simple CRUD approach, I can create, read, update and delete equipment statuses using dapr as follows:
- POST equipment/
- GET equipment/key
- PUT equipment/key
- DELETE equipment/key
And my main problem is getting a list of all keys:
- GET equipment
As dapr doesn't support a list of all keys in the state store, I need to track all keys separately using my own implementation.
https://github.com/dapr/docs/tree/master/concepts/state-management
I've tested two methods so far:
- SAGA pattern where POST/PUT/DELETE equipment calls publish events to an index API
- Manually manage the index in the equipment microservice POST/PUT/DELETE calls
In my view, the above methods add unnecessary complexity and create scale issues.
Is there a pattern for implementing a list of all keys using dapr without the above complexity?