19

I have been using ActiveAndroid for a while and i recently heard about Realm being another good option. I was thinking about changing my app to use Realm but before doing that,i was looking if someone has done the performance comparison between these two. I found some comparison on realm's website but those were with ORMLite and SQLite.

Any suggestions are appreciated.

mudit
  • 25,306
  • 32
  • 90
  • 132

6 Answers6

8

Realm cannot be directly compared to ActiveAndroid as Realm is a mobile database with its own persistence engine built for simplicity and speed to replace the traditional SQLite while ActiveAndroid is an ORM for SQLite. So when moving into Realm means you will no longer be using the traditional SQLite.

Yes, Realm is fast(according to my experience and according to their benchmark tests) but the difference over the traditional SQLite is not noticeable, unless your app uses database transactions or searches heavily, then I suggest you use Realm. If not, then the already working ActiveAndroid would do fine.

Although, I suggest when doing a new project/app, try to familiarize with Realm so that when you would be come up an app that uses database heavily, you really would appreciate the speed of Realm.

steven0529
  • 1,513
  • 1
  • 18
  • 28
2

Active Android last updated two years ago, and Realm is a living project.

Active Android is just wrapper around SQLite database. Realm offers more features like auto-refreshing query results, creation of objects from JSON, or database change notifications.

I think that performance is not relevant unless you inserting millions of records, but if this is true you better use SQL directly.

Evgeny Sureev
  • 1,008
  • 10
  • 16
1

It' better to use Realm. In my last project I used it and it works much better.

In GUI if you want to show list of user who are less than 25 years old.Now you fetch from internet from worker thread but when u will save the data in realm automatically all data will be updated.No need to query again.

It's much faster. And Architecturally easy to use.

Sainik
  • 165
  • 1
  • 3
  • 9
1

Realm is a cross-platform solution available for iOS and Android (which is rather great when you target for both).

1

Hi mudit may be too late answer but it's help other's. Myself Realm is the best option.

Realm

Realm is a mobile database and a replacement for SQLite. Although is an OO database it has some differences with other databases. Realm is not using SQLite as it’s engine. Instead it has own C++ core and aims to provide a mobile-first alternative to SQLite. Realm store data in a universal, table-based format by a C++ core. This is what allows Realm to allow data access from multiple languages as well as a range of ad hoc queries.

Advantage's:

  • faster than SQLite (up to 10x speed up over raw SQLite for normal operations)

  • easy to use

  • object conversion handled for you

  • convenient for creating and storing data on the fly

I used my project it's more than 10 x speed compare to SQlite . Because i added 100000 data(row) in for loop SQlite take 18min but Realm only take 20 sec.

Magesh Pandian
  • 8,789
  • 12
  • 45
  • 60
0

As Realm is a mobile database: a replacement for SQLite & Core Data. For more information please check performance comparison.

But you need to consider another important factor, that is https://realm.io is currently supporting Android and iOS whereas others are Sqllite based so the generated DB you can use even in Windows phones,Tizen etc.

I hope it will be helpful to take the decision.

Shailendra
  • 325
  • 2
  • 10
  • i am not comparing SQLIte and Realm.. i want to compare Active Android & realm. Also the link you posted is for Realm vs core data (so useless). – mudit Sep 10 '15 at 19:50
  • 1
    @mudit the thing is ActiveAndroid is SQLlite based ORM, as per there statement "ActiveAndroid allows you to save and retrieve SQLite database records without ever writing a single SQL statement". This even throws an exception called SQLiteException in certain cases for more information please have a look @ https://guides.codepath.com/android/ActiveAndroid-Guide#overview. I hope it will clear now. – Shailendra Sep 11 '15 at 20:06