Live data from Hacker News

Show HN: Fast database for React Native with multiple data-type support

github.com

1–10 of 22 posts

Re: Show HN: Fast database for React Native with multiple data-type support

#2
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.

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 work to set a number in memory. Is there any reason for this?

Re: Show HN: Fast database for React Native with multiple data-type support

#6
post #3

I’m surprised to not find any iteration or query primitives. No key scanning?

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?

Re: Show HN: Fast database for React Native with multiple data-type support

#7
post #2

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. 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

#9
post #3

I’m surprised to not find any iteration or query primitives. No key scanning?

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

#10
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.
Post reply on HN