-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How is this library different from another mmkv? #100
Comments
As far as I know,
|
Originally there was only react-native-mmkv-storage by ammarahm-ed, which was a legacy bridge module (slow). At that time, I was experimenting with JSI and decided to create a new MMKV library for React Native which was way faster and synchronous by using JSI. So that's what I did, it was a lot faster and you could access all functions synchronously, so no const storage = new MMKV()
const name = storage.getString('name') Whereas with his library you kinda have this loader interface, I don't really know how this works so here's just the code taken from his docs: const MMKV = new MMKVStorage.Loader().initialize(); // Returns an MMKV Instance
// Then make are read/write requests
let string = await MMKV.getStringAsync("string"); So mine has a cleaner and more lightweight interface. It's a matter of personal preference whether you would like to use my library or his. Also:
EditMy library now also supports
So: const storage = new MMKV({
id: 'some-user-storage',
path: ...,
encryptionKey: ...
}) |
Alright, now it is clear, I thought there were fundamental differences. Thank you for making this clear. |
let's leave this open for future reference |
I think in the best interest of RN community would be that your mmkv library and react-native-mmkv-storage merge into 1 library, since they wrap the same storage and have the same functionalities. |
Currently we get to coin-flip which one will stop maintaining their project first 😄 |
Well if you know my libraries, you know that I don't stop maintaining them. All of them work with the latest RN version. Also, since I am running an app development agency, I use react-native-mmkv (and VisionCamera and others) in multiple production apps, so they work there and it's in my (and my clients') best interested to keep the maintained. If you are missing some features or need advanced support/help, or just want to show appreciation, you can always sponsor this project. :) |
Also, I'm not merging my library into his, I like my code, it's very clean and minimal. I also like my API more. And my library was using JSI first 😄 But it's always a matter of preference, you wouldn't prefer someone else's baby over yours would you? |
I meant no offense mate. I ended up digging through the implementation/code thoroughly before choosing your library. I've spent the last hour implementing your migration script (#52 (comment)), and refactoring the codebase (no more await for storage, yay 🎉 ). So far it's been painless and I'm thoroughly impressed with this library. Thanks for your efforts @mrousavy ! I'll consider sponsoring. 💯 |
Thank you Raymond, and no offense taken! |
hi, first of all thanks for this great library! I wanted to know is there any difference or security risk in providing the encryption key in JS code vs generating a random key and storing in keychain(which react-native-mmkv-storage does https://github.com/ammarahm-ed/react-native-mmkv-storage#full-encryption-support)? |
Hi! Storing the encryption key in keychain seems to be a good idea, you can either manually do that or shoot me a PR so I can add it to MMKV :) |
Storing in the key chain should not be part of this library, there are other libraries out there already handling this I think. |
@mrousavy Hey I have a question, I am currently using the react-native-mmkv-storage package but want to shift to your package, can I do so without breaking my app? |
@Aman1706 do you want users to keep their data? I would recommend to wipe all of the data and set up a new storage. This means that your users will probably need to log in again. This would be the simplest approach, if you have critical data stored in MMKV that you can't wipe, it will still be possible (we both use the same MMKV lib under the hood), but you need to test it carefully. |
@mrousavy Yeah ideally I would like the users to not have to logout, but there is nothing critical per say |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
other difference: this owner was handsome more than mmkv-storage owner ✌️ |
I would love to see this working out of the box with keychain ❤️ |
Has it been discussed having a similar API for the encryption as react-native-mmkv-storage? const storage = new MMKVLoader() What is the currently recommended approach if you want to store something somewhat securely with this library? If I keep the encryption key on the client I assume it could easily be found and used by someone with malicious intent |
This is how react-native-mmkv-storage generates an encryption key. It's just a random string that changes on every call. |
@mrousavy but they store that encryption key on the keychain right? To get similar level of security with this lib I would have to implement the storing of the encryption key on the keychain myself I guess? Or maybe I am misunderstanding something. export const storage = new MMKV({ With the react-native-mmkv-storage solution I would have to get their individual encryption key from their keychain in order to decrypt what has been stored with it right? Would be so amazing if this library offered similar security level as one of the libraries mentioned here so it could be the first sync secure library endorsed by React Native. |
And we have a winner I think 🎉 |
How is this library different from another mmkv react-native library?
https://github.com/ammarahm-ed/react-native-mmkv-storage
The text was updated successfully, but these errors were encountered: