Posts

Difference between Realm -vs- Room in Android

Today I’m going to discuss some pros and cons of Realm and Room for Android data persistence.   Room  was introduced at Google I/O 2017 as part of the  Android Architecture Components .  Realm  is a mobile database solution that was launched for Android in May 2014 and has become a feature-rich choice for data persistence. 1     Room is just a layer over the native SQLite that comes stock with Android. As such there is a large amount of customizability in the queries (you write your queries in SQL and they are validated at compile time).                     Room also requires that relationships be created using foreign keys and the like, so complicated object graphs can be a bit of a pain to implement. Realm on the other hand requires no SQL knowledge. You do not have to write any SQL statements and object relationships are incredibly simple to implement.    ...