Offline work flow - htalexnguyen/htapp GitHub Wiki

Current approach:

RealmJs

  • non relational DB, so some related data is stored as JSON string. Example: Inspection record has employerEntried field which is an array, and it is stringified and stored as string.
  • doesn't support asynchronous & multi-threading.
  • need to handle listeners to reflex changes on UI.
  • need to handle multiple endpoints & params, offline-queue, retry .. to sync changes to remote.
  • need need redux-offline lib.
  • very slow when using debugger

New approach

WatermelonDB

  • relational DB, same as backend.
  • support asynchronous & multi-threading.
  • automatically reflex changes with observable HOC
  • only 2 endpoint needed.
  • support multiple types of database.
  • no need redux-offline ...
  • build with JSI (RN new architecture is using JSI). Read more about JSC vs JSI
  • batch processing

additional

https://www.youtube.com/watch?v=uFvHURTRLxQ