Mention mmkv being an in-memory store#944
Mention mmkv being an in-memory store#944ferretwithaberet wants to merge 2 commits intomrousavy:mainfrom
Conversation
Adds additional information about MMKV being an in-memory store backed by `mmap` to avoid confusion. This gives more context for people that do not know what `mmap` or `MMKV` are or how they work. I, personally, made the mistake of persisting tanstack query's cache with `maxAge: Infinity` to `react-native-mmkv`, without ever realizing that it is an in-memory store and that I am filling the RAM of my users' devices.
|
I agree. I didn't know the fetches were happening from RAM. Especially if all data is stored in ram without LRU cache. (not sure if this is how it works) However, I think your explanation complicates understanding. @ferretwithaberet. I'd prefer you keep the line:
and add
As an additional line. Please correct me if I've made any mistakes in understanding. |
|
Yea I did the same thing a few years ago! |
It's not meant to be the clearest description. I meant for it to bring the "in-memory" word in the user's face, this should raise some question marks and they will dig deeper (by clicking on the MMKV link hopefully).
As mentioned above, I'd rather keep the description small and concise with few important keywords. Users will likely tend to skip over long blocks of text so they might miss the information. I'd rather make the "in-memory" word bold, so they instantly see it. I also wanted to keep the "synced with files" part and the mmap mention so users get an ideea of how it works, I guess the mmap part could be omitted and mentioned somewhere else, but the "synced with files" part should stay, maybe just reworded. |
Adds additional information about MMKV being an in-memory store backed by
mmapto avoid confusion. This gives more context for people that do not know whatmmaporMMKVare or how they work.I, personally, made the mistake of persisting tanstack query's cache with
maxAge: Infinitytoreact-native-mmkv, without ever realizing that it is an in-memory store and that I am filling the RAM of my users' devices.