React Native Database - Choosing The Right Database For Your React Native App
React Native Database - Choosing The Right Database For Your React Native App
Quick Summary :- React Native, the framework hailed as the best choice for developing React
Native apps has some relatively good options for data storage. Let's explore these options in this
article.
https://www.simform.com/react-native-database-selection-guide/ 1/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
RealM / / / / /
ABOU T US SERVIC ES HIRE CASE ST UDIES H OW IT WORKS BLOG CONTACT US
React
Firebase
Native vs
Swift
SQlite
PouchDB
AsyncStorage class
React
Watermelon DB Native vs
Ionic
Vasern
https://www.simform.com/react-native-database-selection-guide/ 2/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Performance of Realm
In terms of performance, Realm databases have been proven to run
queries and sync objects significantly faster than SQLite and others.
The objects stored in Realm can be accessed concurrently from
multiple threads or sources, and it doesn’t require any specific lock
configuration.
https://www.simform.com/react-native-database-selection-guide/ 3/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
your database
/
and it doesn’t
/
convert
/
the objects /while doing /
ABOU T US SERVIC ES HIRE CASE ST UDIES H OW IT WORKS BLOG CONTACT US
read/write operations.
For SOX and GLBA compliances, Realm has been considered secure
enough to use.
Realm Pricing
Realm Database is 100% open source and free. Realm costs $1750 –
for the pro version, there’s a commercial version available for free as
well.
But, when you buy their platform to build React Native applications,
then it will cost you $1750 per month. They also have an edition
which comes with Realm Studio, and tons of other development
features for Enterprises.
https://www.simform.com/react-native-database-selection-guide/ 4/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Benefits of Firebase
Listed below are some of the well-known advantages of Firebase:
https://www.simform.com/react-native-database-selection-guide/ 5/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Encryption
ABOU T US / SERVIC ES / HIRE / CASE ST UDIES / H OW IT WORKS / BLOG CONTACT US
Firebase Pricing
Firebase is free upto 1GB data storage. However, it also offers a
minimal price of $ 25 for 2.5 GB data storage and a pay-as-you go
package. Here’s an image showing firebase pricing:
https://www.simform.com/react-native-database-selection-guide/ 6/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Apart from SEE, there are several others implementations with which
you can encrypt your data in SQLite :
https://www.simform.com/react-native-database-selection-guide/ 8/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
React Native
PouchDB is an open source Javascript Database, which stores data in
a JSON format and allows you to: create, read, update, delete and
query your objects with a simple JavaScript API. The API can be
accessed with a single call on React Native platform, which is also
based on Javascript.
It does stores cookies from the app, but keep refreshing every
10 minutes, which reduces possible attacks on the cookie.
https://www.simform.com/react-native-database-selection-guide/ 9/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
It supports
/
SSL, so you/can easily
/
encrypt your local
/
data with /
ABOU T US SERVIC ES HIRE CASE ST UDIES H OW IT WORKS BLOG CONTACT US
an AES256 level of encryption.
PouchDB Pricing
PouchDB development and updates are publicly available on Github
and it’s free to use.
All objects stored in the class named Async Storage are considered
as strings, all value must be serialized before storing, and
deserialized after retrieving. That explains its slow runtime and no
indexing capability. You should not use Async Storage while dealing
with a large amount of data.
Async Storage doesn’t offer any offline Capability unless you bind it
with another full-scale database like SQLite, or Realm.
https://www.simform.com/react-native-database-selection-guide/ 10/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Vasern
Vasern is fast, lightweight and open source data storage for React
Native. It’s API is developed not only for local data storage but also
for cloud storage and sync across app clients. It is built using
Golang – which is a powerful server side language created by
Google.
https://www.simform.com/react-native-database-selection-guide/ 11/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Realm
SQLite
PouchDB
I believe these metrics would be enough for 95% of the startup and
enterprise building their apps with React Native.
MySQL for React Native
https://www.simform.com/react-native-database-selection-guide/ 12/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
There are few libraries that will allow you to use SQLite with React
Native and MySQL. Also, realm works in a great way with MySQL
when you are working on Android.
MySQL Compliances
As mentioned above, MySQL can be used to store larger data. So, if
you are on a hunt for the server side database which can serve large
chunks of data across server, it must be your best bet in that case.
https://www.simform.com/react-native-database-selection-guide/ 13/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Native
Amazon DynamoDB was designed and developed as a fully-fledged
and managed NoSQL database service which runs on the AWS
cloud.
Performance in DynamoDB
DynamoDB is performance optimized as it automatically made the
data transfer on tables easier over multiple tables.
While using DynamoDB, you don’t need to take care of scaling and
operating of a distributed database. Moreover, complex
functionalities of a distributed database such as initial setup,
configuration, cluster scaling, replication etc. are managed by
Amazon.
You only need to use the API provided, else rest is taken care of.
Security in DynamoDB
With DynamoDB, encryption is easier. When it comes to server-side
encryption, data is transferred by the user in an unencrypted form on
the server where it will be then encrypted after uploading. Amazon
KMS can be used to manage keys.
Conclusion
https://www.simform.com/react-native-database-selection-guide/ 14/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
But, when your data is unstructured and complex or when you can’t
accurately define your schemas, MongoDB would be the better
choice. MongoDB will meet all your challenges with their document-
based data modeling.
Hardik Shah
Working from last 8 years into consumer and
enterprise mobility, Hardik leads large scale
mobility programs covering platforms, solutions,
governance, standardization and best practices.
Fuhrmann
NOVEMBER 12, 2017
https://www.simform.com/react-native-database-selection-guide/ 15/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Purvak_simform
NOVEMBER 28, 2017
Fuhrmann
NOVEMBER 28, 2017
Bruno Reis
NOVEMBER 27, 2017
Thanks for this article. Very good information. I think that on these
sentence you wanted to say "server-side" instead of "client-side":
"Realm is a local database, and when combined with a client-side
database such as MongoDB, DynamoDB or MYSQL; developers can
easily interact with the data synced locally in the Realm database."
Purvak_simform
NOVEMBER 27, 2017
Bruno Reis
NOVEMBER 28, 2017
I'm a web dev just getting into RN/mobile world with a big
challenge to make some financial projections in agricultural
activities. Lot's of data and aggregations. I'm starting with
https://www.simform.com/react-native-database-selection-guide/ 16/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Brian Munkholm
DECEMBER 19, 2017
Purvak_simform
DECEMBER 19, 2017
Suman Timalsina
DECEMBER 25, 2017
The only down side of Realm it you can not debug the app after
you use realm. I REPEAT YOU CAN NOT USE DEBUGGER. I wasted a
lot of time to fix it and I give up now and removed Realm form my
project as I can not debug the app.
Purvak_simform
DECEMBER 25, 2017
I think there are ways by which you can effectively debug in Realm.
How does your app architecture looks like?
Ivan Schuetz
JANUARY 27, 2018
https://www.simform.com/react-native-database-selection-guide/ 17/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
In the section about core data you don't mention that this is only
ABOU T US / SERVIC ES / HIRE / CASE ST UDIES / H OW IT WORKS / BLOG CONTACT US
for iOS... isn't this important?
Purvak_simform
JANUARY 27, 2018
Hey Ivan, since Coredata implies iOS, thought many would know.
Seems like I made a poor assumption. Many developers who are
coming from a web dev background wouldn't know about
Coredata and Room either. I'll update the blog post shortly. Thanks
for pointing this out! :)
Ivan Schuetz
JANUARY 27, 2018
Ok, I'm just confused because I'm new to RN and I thought its
main appeal is to develop cross platform apps... so why would
anyone use Core Data with it?
Purvak_simform
JANUARY 28, 2018
Ivan Schuetz
JANUARY 28, 2018
I have worked with Core Data... but it's still not clear to
me what would be the advantage to use this in an RN
app, I mean, you would need to use a different
persistence solution for Android, probably wrap
everything up with a common interface (thus also mostly
losing special features)... you will be always maintaining
these 2 persistence frameworks. Under these
https://www.simform.com/react-native-database-selection-guide/ 18/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Email SIGN UP
Related Posts
Areas We Serve
https://www.simform.com/react-native-database-selection-guide/ 19/20
12/1/2020 React Native Database - Choosing the right database for your React Native app
Services WayPoint
Blog CrayPay
https://www.simform.com/react-native-database-selection-guide/ 20/20