In the iOS implementation, a new dispatch queue is created on each 'set' or 'get' call, from which it switches to the main queue to call MMKV, wrapped in a try/catch block.<p>Inside the MMKV library, a NSData object is created, another class is used to write a single "int" value to it, then the data object is used as the "raw" value for the given key.<p>I haven't looked any futher but already this seems like a lot of work to set a number in memory. Is there any reason for this?
We are using SQLite on React Native with the JSI without writing a java or object C bridge. As a result, all operations are much faster and almost all of them don't need to Promise callback.
I don't see any reason to use this over SQLite. We can do same thing on SQLite much faster way.
Just for the note:<p>Sciter implements what I call "an ultimate data persistence solution" - NoSQL DB integrated right into script VM.<p>You can open storage as:<p><pre><code> var storage = Storage.open("path/to/data/file.db");
</code></pre>
Storage provides root object - normal script object (or array) that can be updated by normal script means:<p><pre><code> storage.root = { foo:[1,2,3], bar: {...} };
storage.root.foo.push(4);
storage.root.bar.newProp = 42;
</code></pre>
All script objects that are accessible from the storage.root are persist-able - pushed to HD on storage.close() or storage.commit();<p>More details about architecture and implementation:
<a href="https://sciter.com/data-persistence-in-sciter-database-integrated-with-the-language/" rel="nofollow">https://sciter.com/data-persistence-in-sciter-database-integ...</a><p>Overall feature set is close to MongoDB (modulo sharding).<p>DB layer uses Konstantin Knizhnik's DyBASE pretty much as it is: <a href="http://www.garret.ru/dybase.html" rel="nofollow">http://www.garret.ru/dybase.html</a>
How does react-native-mmkv-storage store data under-the-hood?<p>When I was building SwiftStore - a KV store [1] for iOS, I went with LevelDB as the choice for the underlying database.<p>LevelDB because it's written in c++ and used widely as an embedded database. Integrating it as a static library in Objective-C is also fairly straight forward.<p>[1] <a href="https://github.com/hemantasapkota/SwiftStore" rel="nofollow">https://github.com/hemantasapkota/SwiftStore</a>