I need a reader-writer grain(s?) to hold some values so other parts of the system can reference them frequently and in parallel.
What I'm after is storing some system-wide config values which are accessed frequently, and subject to change, but only extremely rarely (once a month or so at most). The system should be reconfigurable without downtime. What I'm currently considering is to store the data in some database. Then it will be read at silo startup, and there will be a special callback to read the data again after it changes externally. I don't want to read the data from the database every time I need it because:
I can easily create a reader-writer locked in-memory data store, but Orleans' single-threaded execution policy doesn't allow parallel access to the grain that holds the data. I can think of the following ways to bypass this:
Suggestions?
We found a solution that doesn't require timer-based updates over on GitHub. I'll detail the solution here: