Local-First is the Future, Here’s Why

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 83

  • @galaxies_dev
    @galaxies_dev  9 หลายเดือนก่อน +5

    Try PowerSync for free today: bit.ly/local-first

  • @xregularxjohnx
    @xregularxjohnx 6 หลายเดือนก่อน +7

    nitpick: offline-first is not equivalent to local-first. Offline-first will typically function offline but once the network is available the app will default to using that. Local-first will ALWAYS use the local store of choice first and sync to the network whether there is one available or not.

    • @tartachek
      @tartachek 5 หลายเดือนก่อน

      >> whether there is one available or not
      umm, how can we sync to the network if it's not available?

    • @navidghasemi9685
      @navidghasemi9685 3 หลายเดือนก่อน

      @@tartachek so sync with it when it's available, easy

  • @bradpreston9872
    @bradpreston9872 9 หลายเดือนก่อน +5

    This looks awesome! Thank you for showing this to us. I would be interested in a full tutorial with React Native.

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน +2

      Hope we can make it work!

  • @neneodonkor
    @neneodonkor 8 หลายเดือนก่อน +1

    Isn't it unnecessary for it to sync to their servers before syncing to your database of choice? 10:19

  • @Oseille
    @Oseille 8 หลายเดือนก่อน +3

    what about electricSQL ?

  • @adiazwise
    @adiazwise หลายเดือนก่อน

    Great tutorial on Power Sync! I wasn't familiar with it before,I'm definitely interested in seeing a full tutorial with React Native

  • @ardisukr
    @ardisukr 10 หลายเดือนก่อน +2

    On our project (react-native expo) we are using Apollo GraphQL + Prisma, so when user save something he do some savefunc({ ... }) that comming from [savefunc, {loading, error...}] = useSaveSomething() standard hook.
    Then on api side we do connection with PostgreSQL via prisma ORM. So please answer, how (and were) this powersync could help us to implement offline-first approach?
    Huge like for the pointing out where could I learn more about it

    • @galaxies_dev
      @galaxies_dev  7 หลายเดือนก่อน +1

      PowerSync handles the read path for data from your Postgres, so it takes care of downloading data from Postgres to the client according to rules that you define, and does that in real-time whenever data in Postgres changes.
      PowerSync retains the use of your existing write path e.g. using your API or GraphQL. So you could still use the approach for saving data that you mentioned (the savefunc example)

  • @simonedwards7101
    @simonedwards7101 10 หลายเดือนก่อน +4

    No mention of Realm aka Atlas App Services?

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      I think they are in the process of rebranding, but yeah we could probably add that to the list!

  • @mfaizhussain7
    @mfaizhussain7 4 หลายเดือนก่อน

    does the power sync works like this
    like if i have data which i need to populate in my app
    and use it
    but initially the local db (sqlite) will be empty and api will get called and data will be populated to db and ui
    and second time i dont want to call the api again as i have data stored in local db
    so i want to get it from local db instead again api call
    and i will give a option for force api call for updating the data
    does the power sync will work in between this
    or anyone can explain please go ahead!

  • @glatocha
    @glatocha 2 หลายเดือนก่อน

    so if it uses sqllite than it saves it as a file in the hosting system? Then you need some permissions for that? And your app would not work in the browser?! Do I understand it correctly? How does the browser apps stores it then? LocalStorage?

  • @webdevelopment8760
    @webdevelopment8760 8 หลายเดือนก่อน +4

    Would like to see full tutorial

    • @galaxies_dev
      @galaxies_dev  8 หลายเดือนก่อน +3

      Working on it!

    • @webdevelopment8760
      @webdevelopment8760 8 หลายเดือนก่อน

      Awesome can't wait, thank you

  • @Monstriki
    @Monstriki 3 หลายเดือนก่อน

    What about Couch and Pouch approach?

  • @jan-dawa
    @jan-dawa 10 หลายเดือนก่อน +2

    Local first means a lot of logic on the ui right?

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      Not more than you usually have with managing server state and caching!

  • @JeanPhilippeMaquestiaux
    @JeanPhilippeMaquestiaux 10 หลายเดือนก่อน +1

    But what about having your own infrastructure hosting your postgres server and not relying on an external service...

  • @DoctaV
    @DoctaV 8 หลายเดือนก่อน +5

    Please do a video on your thoughts on InstantDB next.

    • @HunterDotTsx
      @HunterDotTsx 6 หลายเดือนก่อน +2

      Currently using InstantDB in production. It's great!

  • @rayellington1063
    @rayellington1063 9 หลายเดือนก่อน

    Why no mention of Firestore Bundles? Isn't that local first?

  • @stahlmandesign
    @stahlmandesign 10 หลายเดือนก่อน

    I thought the whole point of Supabase was to broadcast an event to all users with the app opened when there was a DB change. If you use PowerSync with Supabase, does it still broadcast events *locally* so the offline app can still consume Supabase events? Or do we have to update data differently when offline, defeating the strongest feature of Supabase?

    • @camstuart
      @camstuart 10 หลายเดือนก่อน

      Yeah that’s what I’m wondering. AFAIK it doesn’t, the UI querying SQLite won’t know new data has arrived. That’s the part I’m wondering about!

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน +1

      I think that's the socket / live connection part of Supabase, but that wouldn't include any kind of offline-first mode for your app. If your app is offline you can't consume Supabase events anyway.
      I'm not entirely sure I get the question, but feel like those are a bit different features!

    • @freddiemotion
      @freddiemotion 9 หลายเดือนก่อน +1

      From my understanding on this local first approaches you technically wouldn't have to listen to these events yourself and do things manually in your app but instead configure the tool you are using (powersync, electric, etc.) with URL of your production DB to listen to those changes on SQLite and keep the Databases up to date. So the flow would be UI -> LocalDB (SQLite) -> Supabase -> AnotherUserLocalDB -> AnotherUserUIUpdated. If a user is offline the one that is online would still see changes in their UI since they are still interacting with the local database first and those changes would still be sent to Supabase. As soon as the other user is online again they should receive those changes via the Supabase to LocalDB Sync update from the tool you are using. Instead of thinking Supabase broadcasting events here think of the tool events that Syncs both remote and local Databases. Also Supabase has many other useful features than just Broadcasting.

    • @galaxies_dev
      @galaxies_dev  7 หลายเดือนก่อน +1

      @@freddiemotion Tools like PowerSync provide reactive live query hooks, which automatically update when the underlying data in SQLite changes. And the SQLite database itself is kept up to date through an HTTP stream / WebSocket. Read more here 👇
      docs.powersync.com/client-sdk-references/js-web#watching-queries-powersync.watch
      www.powersync.com/blog/local-first-state-management-with-sqlite

  • @swiffty1
    @swiffty1 10 หลายเดือนก่อน

    What's the advantage of PowerSync over something like ReactQuery?

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน +1

      Very different purpose, ReactQuery manages server state and caching but it's not a local-first strategy in itself, nor does it keep a queue of offline events or help with merging your operations into the DB after going back online.

  • @BenjaminKomen
    @BenjaminKomen 10 หลายเดือนก่อน

    I kind of missed the point on how to deal with scenarios that multiple users of the app are offline, make changes and then come back online and sync with the backend. How to resolve conflicts?

    • @jamessunderland9284
      @jamessunderland9284 10 หลายเดือนก่อน +1

      CRDTs or structured data merge algorithms. You can basically guess for the user (CRDTs) or create interfaces for users to manually resolve their conflicts like in git.

    • @JoeRomano-s8g
      @JoeRomano-s8g 2 หลายเดือนก่อน

      There usually is a timestamp and last write wins

  • @juankilian8531
    @juankilian8531 10 หลายเดือนก่อน +1

    Full Tutorial please

  • @TheAremoh
    @TheAremoh 10 หลายเดือนก่อน +1

    Great! Anticipating a full tutorial.

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน +2

      Will see what I can do!

  • @paulh6933
    @paulh6933 10 หลายเดือนก่อน +2

    any security concerns?

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      Which exactly?

    • @paulh6933
      @paulh6933 9 หลายเดือนก่อน

      Data is being stored locally, is there automatic clean up to remove it when synced, is the data encrypted?@@galaxies_dev

  • @arthurmtro
    @arthurmtro 7 หลายเดือนก่อน

    Thanks! Anticipating the full tutorial !

  • @zacharyzheng9326
    @zacharyzheng9326 10 หลายเดือนก่อน

    Is pglite belong to local first? thanks

    • @conradh3769
      @conradh3769 9 หลายเดือนก่อน +1

      Yes, pglite is a project to use a lite version of Postgres as the client-side database in web apps (currently). PowerSync uses SQLite as the client-side database.

  • @ansys4579
    @ansys4579 7 หลายเดือนก่อน

    Awesome! Looking forward for a full tutorial

  • @supernova82
    @supernova82 8 หลายเดือนก่อน

    What about the memory space? Many users who have slower internet connections have also smaller memory sizes. Putting the burden of database size and calculations on user's devices can cause some issues. How about slower processors and RAMs? When we call an API, we leave the burden of database calculations on our own servers. It seems like we are moving backward when we didn't use to have REST APIs and cloud.

    • @supernova82
      @supernova82 8 หลายเดือนก่อน

      I am also not sure about the kind of apps that can benefit from the local first approach. For example, I have a restaurant delivery app, and I have to fetch the list of restaurants and dishes from the server. I can't store the whole database on the users' devices. Another example is a shopping website. We will have to sync with the database to know what is sold out and what is available. The apps like ToDo List and Groceries List can benefit from it. The kind of app that doesn't need a lot of syncing.

  • @oliverloops.
    @oliverloops. 10 หลายเดือนก่อน +5

    Create a tutorial Simon, this is an interesting and so useful content 👏

  • @SonAyoD
    @SonAyoD 10 หลายเดือนก่อน

    I need the video for the cons

  • @MatteoCuratolo-oj8lj
    @MatteoCuratolo-oj8lj 6 หลายเดือนก่อน

    I'd really like to see a full tutorial with it

  • @Gheon_Stonecamp
    @Gheon_Stonecamp 10 หลายเดือนก่อน +1

    A tutorial would be great. Very cool information this. Thanx Simon. 😁

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน +1

      Will see what I can do ✌️

  • @gustavoecheverria9312
    @gustavoecheverria9312 10 หลายเดือนก่อน +1

    Cool video Simon. Waiting for the tutorial ...

  • @Alesvetina
    @Alesvetina 10 หลายเดือนก่อน

    Ionic and angular tutorial would be lovely!

  • @gnom-om
    @gnom-om 10 หลายเดือนก่อน +1

    Do not agree. Its an easy task to create backend for WatermelonDB. But from the other hand it looks like Watermelon is abandoned.

  • @makindufabrice8866
    @makindufabrice8866 10 หลายเดือนก่อน

    Hello SIMON. this is amazing.... would you do for us a tutorial in ionic and angular

  • @stancobridge
    @stancobridge 10 หลายเดือนก่อน +1

    nice video Simon

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      Thanks mate!

  • @peterkyle01
    @peterkyle01 9 หลายเดือนก่อน

    Awesome,would like to see a full tutorial.

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      Happy to work on that 💪

  • @AtishAbhang
    @AtishAbhang 10 หลายเดือนก่อน

    Why are your videos 25fps!!!

  • @laughingvampire7555
    @laughingvampire7555 10 หลายเดือนก่อน

    local first should've been the default behavior since the beginning when we had worse networks, but still. this should be the default, specially with youtube premium

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      Agree!

    • @supernova82
      @supernova82 8 หลายเดือนก่อน

      You mean since the beginning when we had the first cellphone or even before that? When we had worst network we also had weaker devices with smaller RAM and memory sizes. Also, the processors were slower. Leaving the burden of database space and calculations on user devices was not a good idea. I am not even sure about now.

  • @Fervillanuevas
    @Fervillanuevas 8 หลายเดือนก่อน

    Wtf I just open the video and stars 10 seconds before end

  • @pacoperico1109
    @pacoperico1109 10 หลายเดือนก่อน

    This tech will empower frontend developers again, LOL

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 6 หลายเดือนก่อน

    What I'm seeing here is that "offline-first" is not an afterthought. It's quite literally the first technical decision you make for a project.

    • @galaxies_dev
      @galaxies_dev  6 หลายเดือนก่อน

      It should be like that in the future!

  • @gorudonu
    @gorudonu 9 หลายเดือนก่อน

    that looks very similar to electricSQL

    • @galaxies_dev
      @galaxies_dev  9 หลายเดือนก่อน

      They are, but have some important differences (as outlined in the video)

  • @smallsnippets
    @smallsnippets หลายเดือนก่อน

    local first != offline first

  • @MatteoCuratolo-oj8lj
    @MatteoCuratolo-oj8lj 6 หลายเดือนก่อน +1

    I'd really like to see a full tutorial with it

    • @galaxies_dev
      @galaxies_dev  6 หลายเดือนก่อน

      Working on it!