Are values persisted with .fileStorage
strategy also cached in memory for efficiency?
#3591
-
Apologies if that's documented somewhere and I failed to find it. I'm curious about the under the hood behaviour of
The reason I'm asking is that reading a value from memory is much faster than from file storage. In some scenarios when, for example, you need to read the same persisted value multiple times in a row, I'd ideally prefer if only the first read used the file storage and the rest utilised in memory caching. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @armanarutiunov, yes that is how it behaves, and how |
Beta Was this translation helpful? Give feedback.
Hi @armanarutiunov, yes that is how it behaves, and how
@Shared
behaves in general. It always keeps state in memory, and it synchronizes with the external system by writing to it when the state is changed, and subscribing to changes in the external system in order to play back to the in-memory state. This means if you were to edit the file directly on the file system, the@Shared
state would also update.