Show HN: Fast database for React Native with multiple data-type support
11–20 of 22 posts
Re: Show HN: Fast database for React Native with multiple data-type support
#12We 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.
Re: Show HN: Fast database for React Native with multiple data-type support
#13In 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. 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. I haven't looked any futher but already this seems like a lot of wor…
I think you are right. I was focusing on basic implementation. Now I will make the performance optimizations needed. For example using a single instance of created class for all get set methods and not create them on every call. Thanks for pointing it out. The second thing about numbers is that its just in case you needed it for something, it is there but there are other ways to set the data too.
Re: Show HN: Fast database for React Native with multiple data-type support
#14Sciter implements what I call "an ultimate data persistence solution" - NoSQL DB integrated right into script VM.
You can open storage as:
var storage = Storage.open("path/to/data/file.db");
Storage provides root object - normal script object (or array) that can be updated by normal script means: storage.root = { foo:[1,2,3], bar: {...} };
storage.root.foo.push(4);
storage.root.bar.newProp = 42;
All script objects that are accessible from the storage.root are persist-able - pushed to HD on storage.close() or storage.commit();More details about architecture and implementation: https://sciter.com/data-persistence-in-sciter-database-integ...
Overall feature set is close to MongoDB (modulo sharding).
DB layer uses Konstantin Knizhnik's DyBASE pretty much as it is: http://www.garret.ru/dybase.html
Re: Show HN: Fast database for React Native with multiple data-type support
#15can someone tell me what this is used for? Is this like a replacement for localstorage?
Yes its a replacment, a very fast one with all datatypes support, not only strings.
Re: Show HN: Fast database for React Native with multiple data-type support
#16Earlier quoted context omitted.
Yes its a replacment, a very fast one with all datatypes support, not only strings.
Is it possible to use it at the native layer (objective-c / java )? My use case is for storing/reading info before react-native JS is bootstrapped. I've tried using AsyncStorage for that but the bindings for objective-c isn't straightforward at all!
Re: Show HN: Fast database for React Native with multiple data-type support
#17Earlier quoted context omitted.
MMKV is a simple key-value store but the good thing is that it is fast, A custom indexer can be made for querying. However there is a method to get all the keys in the storage but its not exposed in react native side. Is that what you mean?
I couldn’t find any numbers or benchmarks in the repo. What did I miss?
Re: Show HN: Fast database for React Native with multiple data-type support
#18We 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.
Re: Show HN: Fast database for React Native with multiple data-type support
#19Earlier quoted context omitted.
I think you are right. I was focusing on basic implementation. Now I will make the performance optimizations needed. For example using a single instance of created class for all get set methods and not create them on every call. Thanks for pointing it out. The second thing about numbers is that its just in case you needed it for something, it is there but there are other ways to set the data too.
Why use a dispatch queue at all? You don't use an Executor on Android. Example usage of MMKV doesn't seem to show putting it in queues.
Re: Show HN: Fast database for React Native with multiple data-type support
#20Why use this over SQLite?