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

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024

Комментарии • 85

  • @brandonquintanillaquispe5455
    @brandonquintanillaquispe5455 6 месяцев назад +22

    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!

  • @revs87
    @revs87 6 месяцев назад +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 6 месяцев назад +2

    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 6 месяцев назад +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  6 месяцев назад +1

      Thanks for sharing!

    • @MonichGPT
      @MonichGPT 6 месяцев назад +1

      How convenient is it to conduct migrations in SQLdelight?

    • @andrewtfluck
      @andrewtfluck 6 месяцев назад +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.

  • @jozefforgac1901
    @jozefforgac1901 6 месяцев назад +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 6 месяцев назад +2

      No, I think you did the right choice.

    • @fenix1058
      @fenix1058 6 месяцев назад

      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

  • @mhdanwar
    @mhdanwar 6 месяцев назад +16

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

    • @PhilippLackner
      @PhilippLackner  6 месяцев назад +8

      It does, like everything 😄

    • @RapCaviar_
      @RapCaviar_ 6 месяцев назад +11

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

    • @RapCaviar_
      @RapCaviar_ 6 месяцев назад +2

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

    • @ChrisAthanas
      @ChrisAthanas 6 месяцев назад

      Would up like to share your experiences?

    • @JeffreyLiu8
      @JeffreyLiu8 6 месяцев назад +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.

  • @MonichGPT
    @MonichGPT 6 месяцев назад +7

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

  • @filipmanevski9872
    @filipmanevski9872 6 месяцев назад +3

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

  • @skyles146
    @skyles146 6 месяцев назад +4

    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 6 месяцев назад +1

      What were these limitations?

    • @raymondmichael4987
      @raymondmichael4987 5 месяцев назад

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

    • @skyles146
      @skyles146 5 месяцев назад

      ​@@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 5 месяцев назад

      @@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...

  • @FreedivingTrainer
    @FreedivingTrainer 6 месяцев назад +5

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

    • @PhilippLackner
      @PhilippLackner  6 месяцев назад +1

      How comes?😄

    • @MarkAndrachekJr
      @MarkAndrachekJr 6 месяцев назад +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 6 месяцев назад

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

    • @FreedivingTrainer
      @FreedivingTrainer 6 месяцев назад +2

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

    • @crazyba2na
      @crazyba2na 6 месяцев назад +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

  • @akn638
    @akn638 6 месяцев назад +3

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

  • @tch.777
    @tch.777 6 месяцев назад +2

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

  • @antonpripachkin5270
    @antonpripachkin5270 6 месяцев назад +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  6 месяцев назад +3

      That's good to know, thanks for adding

  • @akashsinha5148
    @akashsinha5148 6 месяцев назад +1

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

  • @maddymr8013
    @maddymr8013 6 месяцев назад +8

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

    • @pattmehta5835
      @pattmehta5835 6 месяцев назад

      only if your name is haramid

    • @maddymr8013
      @maddymr8013 6 месяцев назад

      @@pattmehta5835 what?

  • @aaravbansal6193
    @aaravbansal6193 6 месяцев назад +3

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

  • @neerajverma9226
    @neerajverma9226 6 месяцев назад +5

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

    • @neronguyenvn
      @neronguyenvn 5 месяцев назад

      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

  • @annoyedstudent2146
    @annoyedstudent2146 Месяц назад

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

  • @user-gb9wr5zc7k
    @user-gb9wr5zc7k 6 месяцев назад +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 5 месяцев назад +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 3 месяца назад

      @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?

  • @asrar4907
    @asrar4907 6 месяцев назад +1

    Please keep doing what you are doing.

  • @mikelantzelo
    @mikelantzelo 6 месяцев назад

    Thank you. Great work as always!

  • @kivan26
    @kivan26 6 месяцев назад +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.

  • @kalios01
    @kalios01 6 месяцев назад +2

    Thanks dude 😎

  • @enossalar8837
    @enossalar8837 6 месяцев назад

    Thank you so much, you help us a lot.

  • @Dipj01
    @Dipj01 2 месяца назад

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

  • @MonichGPT
    @MonichGPT 6 месяцев назад +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!

  • @bitwisedevs469
    @bitwisedevs469 4 месяца назад

    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.

  • @muhamadazamudin2023
    @muhamadazamudin2023 6 месяцев назад +1

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

  • @DroidDev25
    @DroidDev25 18 дней назад

    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

  • @__J____ff
    @__J____ff 13 дней назад

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

  • @dendroid4389
    @dendroid4389 6 месяцев назад

    great tutorial

  • @Carol-b8Carol___8ome
    @Carol-b8Carol___8ome Месяц назад

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

  • @misakozelk
    @misakozelk 6 месяцев назад +1

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

  • @zhimbura
    @zhimbura 19 дней назад

    One thing to think, how to avoid nullable properties?

  • @rdanish78
    @rdanish78 6 месяцев назад +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 6 месяцев назад

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

    • @rdanish78
      @rdanish78 6 месяцев назад

      @@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.

  • @bloodops3893
    @bloodops3893 6 месяцев назад

    It was interesting 👨‍💻

  • @truposzcz
    @truposzcz 6 месяцев назад

    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 6 месяцев назад

    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?

  • @a.rohimsama7222
    @a.rohimsama7222 6 месяцев назад +1

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

    • @ChrisAthanas
      @ChrisAthanas 6 месяцев назад +2

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

  • @kinglamido
    @kinglamido 6 месяцев назад

    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

  • @ubersticks
    @ubersticks 6 месяцев назад

    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?

    • @user-gb9wr5zc7k
      @user-gb9wr5zc7k 6 месяцев назад

      Realm studio. But not as handy as DB inspector.

  • @XeaLStorm
    @XeaLStorm 6 месяцев назад

    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.

  • @muhammadasimsiddiq7344
    @muhammadasimsiddiq7344 6 месяцев назад

    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

  • @SandeepRajput-mq4mf
    @SandeepRajput-mq4mf 6 месяцев назад

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

  • @neerajverma9226
    @neerajverma9226 6 месяцев назад

    Atlas version is better? try realm sync?

  • @lindaporsius
    @lindaporsius 4 месяца назад

    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?

  • @GN9K71
    @GN9K71 6 месяцев назад

    Is Realm suggested by Google?

  • @serbanmihnea1158
    @serbanmihnea1158 6 месяцев назад

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

    • @serbanmihnea1158
      @serbanmihnea1158 6 месяцев назад

      not Real, Realm*

    • @ChrisAthanas
      @ChrisAthanas 6 месяцев назад +1

      You know you can edit your comments, right?

  • @ka61er
    @ka61er 6 месяцев назад

    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 6 месяцев назад

    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?