FORUMS
Remove All Ads from XDA

android db (SQLite, Realm or Redus)

16 posts
Thanks Meter: 4
 
By smaug117, Junior Member on 15th August 2017, 11:45 PM
Post Reply Email Thread
I have a to chose between those Database :SQLite, Realm or Redux
witch one is the best for regular db update ?
4th November 2017, 12:26 PM |#2  
Member
Thanks Meter: 38
 
More
Hi smauh117, this is my opinion:

Persistence - why Realm, not Room (SQLite)?

Room Persistence Library is a part of google's android acrhitecture components announced Google IO 2017. It provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite, works well with LiveData.

But, SQLite is not simple, and relational database is not easy for a lot of android developers. In almost android application, local database is offen used for data caching only, and isn't center of bussiness processes.

Realm is a mobile database, a replacement of SQLite and ORMs. It is much more simple than SQLite, but really powerfull, easy to learn in minutes, not hours, for every mobile deveopers, both Android and iOS. Even "Realm Database is much faster than an ORM, and often faster than raw SQLite". With lazy data loading, your app can easy to archive better performance and user experience, it's really difficult if you are using Room.

Room works well with LiveData and lifecycle aware to prevent memory leaks, how about Realm ?

It dosen't matter, Realm can easy to adapt with LiveData, read more: Android Architecture Components and Realm.

For full article and source code, please visit my project here.


I also created this project to compare Realm and SQLite (with ROOM). Please checkout different branches.
1st December 2017, 07:02 PM |#3  
Junior Member
Thanks Meter: 0
 
More
Thank you
17th June 2018, 04:07 AM |#4  
Junior Member
Thanks Meter: 0
 
More
25th September 2018, 05:05 PM |#5  
Junior Member
Thanks Meter: 38
 
More
Quote:
Originally Posted by smaug117

I have a to chose between those Database :SQLite, Realm or Redux
witch one is the best for regular db update ?

AFAIK: Redux is an architectural pattern and not a database like Realm and what do you mean by "regular db update" ?
Anyway, Google's Room is a pretty good and established abstraction layer over SQLite on Android. I don't recommend Realm because there're a couple of pitfalls regarding multithreading. If you don't want to use SQLite + Room check out Objectbox.
15th October 2018, 11:08 PM |#6  
Junior Member
Flag Syndey
Thanks Meter: 0
 
More
Quote:
Originally Posted by smaug117

I have a to chose between those Database :SQLite, Realm or Redux
witch one is the best for regular db update ?

SQLIte/Room may not be the best option depending upon what you actually mean by regular db update.

That is SQLite and therefore Room (Room being an abstraction layer over SQLite) is intended as an embedded database and thus each device has it's own distinct database and synchronisation with external data would have to be coded/developed, just pulling data from one source wouldn't be overly difficult. However, two/multiple way/device synchronisation would introduce complexities and hence why many solutions use other databases that are intended as a client server solution (e.g. MYSQL for example).

Firebase, not that I've used it, could be a solution as this is a client/server solution and is designed for Android use.

Personally I find native SQLite easier and therefore faster to use than Room. I've never used Realm.
2nd December 2018, 12:38 AM |#7  
Junior Member
Flag London
Thanks Meter: 1
 
More
it depends on your data architecture, if you'd like to use a non relational database just go with Realm, it's like mongo for mobile apps, otherwise there is Room, which represent the relational database by using Sqlite.
18th September 2019, 08:52 PM |#8  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by @MJT

SQLIte/Room may not be the best option depending upon what you actually mean by regular db update.

Personally I find native SQLite easier and therefore faster to use than Room. I've never used Realm.

I completely agree. I use SQLite to save user preferences in the application. It is simple and stable.
And this is a cross-platform solution (not only for android).
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes