The Ultimate Beginners Guide to Realm DB on Android (CRUD with Multi-Relations)

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ •

  • @brandonquintanillaquispe5455
    @brandonquintanillaquispe5455 11 місяців тому +26

    Realm is great. I have been using it for four years in a large long term project. A hidden disadvantage is that it some times it is not 100% compatible with new gradle versions. It is like Realm is one step behind official google products (Like Room). In my case, that blocked the project upgrade until there was a new realm-gradle compatible version. Even that, thank you Philipp, great content like always!

    • @AryanMishra-ui9de
      @AryanMishra-ui9de Місяць тому

      u lack in teaching say point by points mini projects try not to directly create a course app

  • @revs87
    @revs87 11 місяців тому +15

    Performance and boilerplate had me.
    Here are a few Q's:
    1. Is there a realm db/schema version number that needs to be applied?
    2. On app updates, is there the possibility to migrate old db versions?
    3. Did you find any documentation regarding db backups (export/import)?
    Thanks for the extended implementation details.

  • @neosuperstar
    @neosuperstar 11 місяців тому +3

    I am French, I recently completed studies as an Android developer, and I wanted to thank you for your work, because it helps me enormously on a daily basis. And clearly, I am far from being the only one. Many thanks to you for sharing your knowledge ♥

  • @moldovanpeter5123
    @moldovanpeter5123 11 місяців тому +10

    Great video, also let me give you a brownfield scenario, android uses realm-java, iOS realm-swift, and you want to extract the data layer into KMP using realm-kotlin.. We did a POC and the result is choosing SQLdelight, also benchmark testing was done and SQLdelight handles transactions better.

    • @PhilippLackner
      @PhilippLackner  11 місяців тому +1

      Thanks for sharing!

    • @MonichGPT
      @MonichGPT 11 місяців тому +1

      How convenient is it to conduct migrations in SQLdelight?

    • @andrewtfluck
      @andrewtfluck 11 місяців тому +1

      ​@@MonichGPT It's pretty simple and well documented. It's just a folder containing your migrations with versions, and of course, it's all normal SQL.

  • @filipmanevski9872
    @filipmanevski9872 11 місяців тому +3

    I haven't used Realm before but im gonna start using this. It looks amazing!

  • @MonichGPT
    @MonichGPT 11 місяців тому +7

    What about "var" instead of "val" and no data class support? Doesn't that seem bad?

  • @akn638
    @akn638 11 місяців тому +3

    Hi Philip absolutely love your videos! Do you have in your mind that you localize price for your courses?

  • @mhdanwar
    @mhdanwar 11 місяців тому +16

    we are using using realm since 2018. realm has also some limitations.

    • @PhilippLackner
      @PhilippLackner  11 місяців тому +8

      It does, like everything 😄

    • @EgregriousClone
      @EgregriousClone 11 місяців тому +12

      I expeted to see The limitations here. 😵‍💫😵‍💫

    • @EgregriousClone
      @EgregriousClone 11 місяців тому +2

      I expeted to see The limitations here. 😵‍💫😵‍💫😊

    • @ChrisAthanas
      @ChrisAthanas 11 місяців тому

      Would up like to share your experiences?

    • @JeffreyLiu8
      @JeffreyLiu8 11 місяців тому +1

      You don't have easy way to see the whole encrypted DB in Android studio, I miss db viewer in Android studio with room.

  • @antonpripachkin5270
    @antonpripachkin5270 11 місяців тому +3

    Last time I used it it added quite a few MBs to final apk size, which is a no go for lots of apps

    • @PhilippLackner
      @PhilippLackner  11 місяців тому +3

      That's good to know, thanks for adding

  • @tch.777
    @tch.777 11 місяців тому +2

    I enjoy your content so much every time.
    You are an angel, thank you!!

  • @aaravbansal6193
    @aaravbansal6193 11 місяців тому +3

    Hii, Can u please make a video on MEDIA3 AUDIO PLAYERS and their implementation??

  • @DawidCzopek
    @DawidCzopek 11 місяців тому +1

    We use realm in our project for several years now and we slowly migrate to room becouse of production issues with migrations on specific users environments (realm sometimes just crashes), with room (that we use in other projects) we do not have such issues.

  • @wolfrudel7624
    @wolfrudel7624 9 місяців тому +1

    Should the models (students, address, ...) be created in the data layer?
    Should you also create extra classes in the domain layer and then map the realmdb objects? Or should you use the same classes across the different layers?

    • @MarkOverton-fn4gm
      @MarkOverton-fn4gm 8 місяців тому

      @PhilippLackner
      I have the same question as above. Does it make sense to create a repository in the domain layer and map the realmdb classes from the data layer or does that defeat the purpose of Realm's 'zero-copy' mechanism?

  • @skyles146
    @skyles146 11 місяців тому +6

    Realm is fine but there are many limitations. We moved from Realm to Room 2-3 years ago and there is NO WORLD where we would use Realm again. None.

    • @chazbertino6102
      @chazbertino6102 10 місяців тому +1

      What were these limitations?

    • @raymondmichael4987
      @raymondmichael4987 9 місяців тому

      That's your opinion. I love Mongdb Realm it's awesome 😊

    • @skyles146
      @skyles146 9 місяців тому

      ​@@raymondmichael4987 Of course, this is my opinion; it's a comment section. But this opinion is based on several years of experience at Openium (France). It doesn't come out of nowhere.

    • @skyles146
      @skyles146 9 місяців тому

      @@chazbertino6102 It's heavy, it adds a lot of weight to the APK. That's not possible today.
      We had a lot of issues with Room migrations back then, and before they added Frozen objects, it was hell...

  • @jozefforgac1901
    @jozefforgac1901 11 місяців тому +3

    i literally just decided to make room database project 3hours ago, and then i see this video LMAO u ruined my evening ahahaha

    • @skyles146
      @skyles146 11 місяців тому +3

      No, I think you did the right choice.

    • @fenix1058
      @fenix1058 11 місяців тому

      I'm using for a side project too, but the thing with room is that we manually have to set relationship with objects to reference ids. This is a downsizing for me@@skyles146

  • @kivan26
    @kivan26 11 місяців тому +1

    Ugh, these queries are not type safe.... I don't know if/how Realm supports fields ("columns") names updates, but if it does, queries could easily get screwed during that process, unless there is some tooling for that, or unless Realm offers also type safe API for querying.

  • @dancewithakshara09
    @dancewithakshara09 11 місяців тому +1

    Reality liked it. I am going to ditch adding room in favour of this. In my current project.

  • @MonichGPT
    @MonichGPT 11 місяців тому +1

    Hello!
    I'm creating my own application and trying to figure out how to properly migrate my application to Realm and Device Sync.
    I was faced with a difficult question for myself and did not find a clear answer in the documentation that would suit my needs.
    My question: how to stop synchronizing user data with Atlas for an indefinite period of time? For example, the user may log out or his paid period may expire. Or it may not start yet, but user will start working with the application locally to begin with.
    The documentation says that manually stopping synchronization for a long time is not worth it. How can I then solve this whole matter? Every time a user logs in and logs out, should I copy his data from one database to another? This seems like a bad idea. It could be GBs of data!

  • @seba42886280
    @seba42886280 3 місяці тому

    How would handle a background sync that pull data from a backend and tries to save it into realm, currently we are having a tonne of issues of type "Realm already in a write transaction" since the user might be also trying to save something into the DB.

  • @annoyedstudent2146
    @annoyedstudent2146 6 місяців тому

    Really good video, however I am having trouble setting up the realm dependencies with the new versions catalogue

  • @truposzcz
    @truposzcz 11 місяців тому

    Philipp, can you analyze android situation taking into account. Mobile, weareables, machine learning on mobiles and IoT ?
    IoT is a thing for Android ? or it was left to python

  • @holy_unicorn
    @holy_unicorn 11 місяців тому

    Thanks for your hard work. Could you please answer the following: The library does not support pagination. How much will everything freeze if there are a lot of elements? And how can this moment be corrected?

  • @asrar4907
    @asrar4907 11 місяців тому +1

    Please keep doing what you are doing.

  • @mikelantzelo
    @mikelantzelo 11 місяців тому

    Thank you. Great work as always!

  • @bitwisedevs469
    @bitwisedevs469 8 місяців тому

    Which is more flexible and extensive? Realm or SQLDelight? Also there is now an ongoing effort to migrate Room for KMP support, would like to know what is the advantages of Realm if that happens.

  • @rdanish78
    @rdanish78 11 місяців тому +4

    Please make a video on RTL config and mirroring. Facing some issue with arabic when using emoji & numeric with arabic words it going in reverse direction.

    • @ChrisAthanas
      @ChrisAthanas 11 місяців тому

      Thats unlikely, but please let us know the problems you are seeing

    • @rdanish78
      @rdanish78 11 місяців тому

      @@ChrisAthanas problem is that when is write something in arabic and use some emoji at the end of para but we found those emoji appears before the text when we send messages(Starting point of para). It seems that is RTL config issue.

  • @ubersticks
    @ubersticks 11 місяців тому

    Realm seems like the way to go if you need "joining" which, like you said, is painful in Room. Even for simple database cases, it seems like Realm is easler. One thing that appears missing is the Database Inspector which is extremely handy for Room. Is there a replacement tool for Ream?

    • @DawidCzopek
      @DawidCzopek 11 місяців тому

      Realm studio. But not as handy as DB inspector.

  • @a.rohimsama7222
    @a.rohimsama7222 11 місяців тому +1

    Will Realm works well or any concerns with large data like ~100k records and switching thread to show loading please?

    • @ChrisAthanas
      @ChrisAthanas 11 місяців тому +2

      You will need to test that yourself and let us know what you come up with!

  • @kinglamido
    @kinglamido 11 місяців тому

    We are using in production for 2 year in desktop software, I love it, but don't think its perfect theres some pain point. Overall it's excellent

  • @XeaLStorm
    @XeaLStorm 11 місяців тому

    Great tutorial! Do you know how to observe the RealmDB during the debug process? I used to use Facebook Flipper but it works only with Realm Java SDK, not Kotlin.

  • @maddymr8013
    @maddymr8013 11 місяців тому +8

    If you're familiar with Jetpack - then RoomDB is the best option.

    • @pattmehta5835
      @pattmehta5835 11 місяців тому

      only if your name is haramid

    • @maddymr8013
      @maddymr8013 11 місяців тому

      @@pattmehta5835 what?

  • @FreedivingTrainer
    @FreedivingTrainer 11 місяців тому +5

    😂 started with realm in 2018. It was a huge mistake!
    Still working on removing it from my app!

    • @PhilippLackner
      @PhilippLackner  11 місяців тому +1

      How comes?😄

    • @MarkAndrachekJr
      @MarkAndrachekJr 11 місяців тому +3

      @FreedivingTrainer - similar experience here. Native crashes, incorrect data, threading issues. Migrating a big old java app to kotlin with modern architecture.. it's basically a complete rewrite, but so worth it in the long run.

    • @ChrisAthanas
      @ChrisAthanas 11 місяців тому

      Things may have been updated since then? That was 6 years ago…

    • @FreedivingTrainer
      @FreedivingTrainer 11 місяців тому +2

      @@ChrisAthanas I have updated version from time to time of cause. And some times got new crashes after updating 😂

    • @crazyba2na
      @crazyba2na 11 місяців тому +1

      was looking for that. hidden magic that core was not open source. go away with it. It is a havy dependency, if you dont make clear boundaries. You will have it forever

  • @DroidDev25
    @DroidDev25 5 місяців тому

    I am using realm db and it's connected to mongo db also. Can someone help to know how to update fields in the table which reflect at mongo db also

  • @neerajverma9226
    @neerajverma9226 11 місяців тому +5

    Realm doesn't support paging : but best for chat application

    • @neronguyenvn2
      @neronguyenvn2 10 місяців тому

      could I ask you why it best for chat. i still never implement paging or offline-first sync but im doing a pet chat project so i want to offer offline-first sync

  • @SandeepRajput-mq4mf
    @SandeepRajput-mq4mf 11 місяців тому

    Should't it be more of Realm vs Sqlite than Room?

  • @enos1010
    @enos1010 11 місяців тому

    Thank you so much, you help us a lot.

  • @Dipj01
    @Dipj01 7 місяців тому

    Your tutorial is good, but I feel like Realm has significantly more boilerplate than Room, unless you're writing very complex joins.

  • @kalios01
    @kalios01 11 місяців тому +2

    Thanks dude 😎

  • @neerajverma9226
    @neerajverma9226 11 місяців тому

    Atlas version is better? try realm sync?

  • @muhammadasimsiddiq7344
    @muhammadasimsiddiq7344 11 місяців тому

    I have been using realm for almost 5 years its simple but dont you think room is better than realm as it is supported by google and part of architecture components
    Master Please need explanation

  • @michael-kozel
    @michael-kozel 11 місяців тому +2

    Why that clickbait in thumbnail 🧐😠 I just don't get it. What does it mean?

  • @zhimbura
    @zhimbura 5 місяців тому

    One thing to think, how to avoid nullable properties?

  • @muhamadazamudin2023
    @muhamadazamudin2023 11 місяців тому +1

    Used both, i didn't like realm as your apk will always be bigger size than room

  • @serbanmihnea1158
    @serbanmihnea1158 11 місяців тому

    is Real a realtime database? Can I do auth systems with it?

  • @lindaporsius
    @lindaporsius 9 місяців тому

    I love that you show your crashes as well as your successes. It is the real life.
    Realm sound promising: No more TypeConverters needed as is the case in Room, which again need a json-parser ... all in all a lot of extra code to maintain. Or less in Realm, I mean.
    My main issue with Room is however, that the migration logic is to complex. They promise that auto-migrations work, except in such and such case, than you must do something completely different. How does Realm deal with changes in the model?
    I see below that @revs87 asks about the same?

  • @bloodops3893
    @bloodops3893 11 місяців тому

    It was interesting 👨‍💻

  • @GG9K71
    @GG9K71 10 місяців тому

    Is Realm suggested by Google?

  • @dendroid4389
    @dendroid4389 11 місяців тому

    great tutorial

  • @You-i7h
    @You-i7h 23 дні тому

    10:00

  • @__J____ff
    @__J____ff 5 місяців тому

    SQLDelight is the way. Not Realm. It's very kotlin idiomatic and kotlin multiplatform supporting as well. They simply get it

  • @Carol-b8Carol___8ome
    @Carol-b8Carol___8ome 5 місяців тому

    What lies ahead? Exclusive interview with Binance's CEO offers insights into future developments

  • @LightDante
    @LightDante Місяць тому

    The last time I use realm, I was still a virgin

  • @ka61er
    @ka61er 11 місяців тому

    Used RealmDb in react native and never want to use that again, realmdb is super useless 💀 update is slow, listen data changed is super bad

  • @Symbi0x7
    @Symbi0x7 11 місяців тому

    Does anyone know how to solve the problem of adding a new element to a list (RealmList) inside a transaction ( realm.write {} )? Or can we insert a new element into a RealmList only by first obtaining an object from the db, making a copy (so that it becomes unmanageable), adding an element to the list and then saving?