Hacker News new | ask | show | jobs
by htormey 3326 days ago
What database were you using and what bottlenecks did you run into? Curious as I have yet to work with dbs in React Native.
1 comments

We are using SQLite. The performance bottleneck is not the database itself but conversion between the Java and JavaScript environments.
Obviously almost every react native app out there is accessing a SQL db over the network, and they work fine. Are you seriously saying that it's slower to get data over the react native bridge than over the internet?
No, such a claim would be complete nonsense.

We are using a local database as a mirror for offline use, which is a key requirement. Profiling (a forgotten art nowadays) shows that most time spent during queries is in this bridge and not in the actual queries.

I know realm has a React Native library which I imagine you could use to access the db directly. Can you do something like that with SQLite? I.e access it without going through java/the bridge?
What was the size of the result set?

Have you tried appending '... LIMIT <count> [OFFSET <skip>]' to constrain the per-query result set to a reasonable size?