Offline usage / data sync Xano

Options

Hi all,

We are prepping to implement offline usage to our Draftbit app - our BE runs on Xano. To enable offline usage we are considering WatermelonDB. Question now is - who has experience using Xano in combination with a FE that allows offline usage (thus requiring pulling and pushing data to sync FE and BE);

  1. Which sync method you've applied (timestamp, order number, …)
  2. Consideration of using row locking, diffing, …

Any help / input is much appreciated and very welcome!

Ben

Answers

  • Cameron B
    Cameron B Member, Administrator

    ADMIN

    Options

    I am not an expert, but I can weigh in and say that the date_modified column of any record should be considered, where we only update & create records that have been stored in the localStorage after a last online timestamp has been created.

    To answer your first question, I would use a timestamp.

    To answer your second question, it depends largely on the data that you're updating/creating. Is this a record that is specific to quantity? I would ensure that before the data is synced, we make an active check - if the user, offline, 'ordered' an item with a stock quantity value of 1, but online someone already purchased this item, we can't send a request to purchase this item once the user is back online. We have to check if the values exist first and then perform the requests.

    I hope that this information makes sense, but it's an interesting challenge to overcome. Let me know what else you're wondering. Thanks!