How Do I Work with Offline Data?

Поділитися
Вставка
  • Опубліковано 25 сер 2024

КОМЕНТАРІ • 29

  • @jamesmussett
    @jamesmussett Рік тому +9

    One approach that I've found useful for offline data is to use event-driven architecture so that each change made offline is stored as an event. Rather then sending the content of the underlying data (i.e.: records from a table), you simply send all of the event's that have occurred since the app was last online. Yes there can still be conflicts, but in my opinion they are much easier to manage.

    • @vbaclasses3553
      @vbaclasses3553 Рік тому +1

      You have just peaked my interest into event-driven architecture. I've watch tons of Derek's from CodeOpinion videos, but for the first time I want to know more.

    • @jamesmussett
      @jamesmussett Рік тому

      @@vbaclasses3553 derek’s videos are great. I’ve only had the chance to use event driven architecture once, and it definitely makes a difference if you know what your doing. Especially in scenarios like this.

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +2

      That gives you a better picture of the order of things, which does help with some issues, but it doesn’t really address data conflicts, which is the biggest issue.

    • @jamesmussett
      @jamesmussett Рік тому

      @@IAmTimCorey I completely agree, conflicts are always challenging.
      However, with the above approach you don’t have to worry about conflicts like primary keys in tables when you are inserting data, just as an example.

    • @sirus49
      @sirus49 Рік тому +1

      ​​@@jamesmussett u just use guids and won't be an issue

  • @Norman_Fleming
    @Norman_Fleming Рік тому +3

    Regarding comments that Tim is not providing a solution. The solution is specific to your business and what the user requirements are. One scenario not mentioned is not just that you have 2 changes from 2 locations, but that the changes are logically inconsistent. If user 1 changed the city to match the state, and user 2 changed the state to match the city. Each independent change is valid, but cannot be merged properly. This is where we earn our pay. Providing options to the business team and then making those options a reality.

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +1

      Thanks for sharing. Excellent points.

  • @kostasgkoutis8534
    @kostasgkoutis8534 Рік тому

    Thanks Tim, that was a really helpful nugget of architectural reasoning. We need more of this 😅. I myself have never sofar come across to some similar requirement to this (consolidating delayed and possibly incompatible conflicts, effectively reconstructing the past), and I am glad I came across your video early.

  • @vbaclasses3553
    @vbaclasses3553 Рік тому

    Really enjoyed the video. Lots of food for thought and guidelines of how to approach these challenges. Thank you.

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

    Hello Tim, First thank you for your great videos. I have watched too many already. I want to build a WPF with offline database synchronization Level 4. maybe level 5, not sure yet. Can you point me in some direction on what library to use? or samples? I dont mind to use Azure or google, etc. I have seen too many different options but I would like to use one where the trend is going to guarantee a long term support. Thank you.

  • @sirus49
    @sirus49 Рік тому

    Years ago with a desktop application we built. We used sql server and localdb. We used dacpacs to check for db schema changes to update the localdb. Anyways when they created offline data and needed to sync back to the main server we used syncframework and totally customized it. We also used guids and had logic of what to "take" if there is conflicts from the server or client. It got pretty complicated to where eventually we built our own custom sync. Curious do you recommend a certain framework for syncing and then customizing it? Again I know it all depends on what you are doing. Just wondering if you have used any sync frameworks yourself or just built your own.

    • @IAmTimCorey
      @IAmTimCorey  Рік тому

      There are frameworks out there, and I mentioned a few technologies in this video, but at the end of the day they all take customization based upon your specific circumstances. I've found that even inside your specific scenario, you end up having different rules for different data.

    • @chrisjohansson9971
      @chrisjohansson9971 Рік тому

      @@IAmTimCorey You mentioned sqllite and pouchdb. but just curious which ones you liked working with personally and have used for any given project. Do you usually build your own... i know it all depends, just wondering what you have worked with and liked

  • @valadares462
    @valadares462 Рік тому +3

    Tim I've been following you for years and this was the first video of yours that I didn't like. you talked about a common problem for all developers, but you didn't give any solutions. only brought questions and no answers.

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +1

      This is because I took you as far as I could. Each situation is specific and needs to be handled that way. There are high level concepts that we can talk about (this video), but I can’t say “do this”. Even for your specific situation, you will need to do things differently for different parts of your data. Offline data is HARD.

  • @waitingforyou2082
    @waitingforyou2082 Рік тому

    You explained the different situations but you didn't actually give us any techniques that we can you to resolve those situations 🤔

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +2

      I got you as close as I could. Even for your specific situation, you will probably mix and match these solutions. Offline data is either simplistic (read-only) or it is a custom solution for a given situation. Anyone that says “just do this” is incorrect and giving bad advice. Offline data that isn’t just read-only is HARD!

    • @waitingforyou2082
      @waitingforyou2082 Рік тому

      @@IAmTimCorey Thanks Tim for all your efforts we really appreciate it.

  • @kandycan
    @kandycan Рік тому

    You use one drive and all of the rest. C'mon man, say it. Say it that it's Google drive 😂 🥴😜

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +1

      I actively avoid Google drive. Google has burned me too many times with cool tech that they've dropped.

    • @kandycan
      @kandycan Рік тому

      @@IAmTimCorey 😆🤣