I am working on a small web app that stores user data locally using indexedDB which can be imported/exported by making use of JSON files. Since I plan on adding updates to the site, I want to know what best practices I should follow to make sure my app can allow importing of user data from older versions. It could be related to how I should define the properties of my user data object to make it future proof, or any library or tool I could implement that would make this migration process easier.

Do keep these points in mind:

  1. I am using NextJS to build this application and Dexie to manage indexedDB
  2. Without going into details, the user data file makes use of heavily nested objects and arrays and most likely won’t fit in a cookie or even in the local storage API
  3. This web app acts as a proof of concept which must only make use of the aforementioned core technologies, regardless of whether more efficient alternatives exist or not.
  • undefined@links.hackliberty.org
    link
    fedilink
    arrow-up
    1
    ·
    5 days ago

    Yeah everyone says this then I look around at REST APIs (as a consumer and developer) and 99% are trash.

    I’m loving GraphQL mainly for “take only what you need” and type definitions. Every other standard I can find has some crummy gem, serializers that need to be hacked because they never work out of the box, etc.

    As soon as my experience changes maybe I’ll change my mind, but I’ve had to develop some REST APIs using Ruby and Rails and wasn’t happy. Meanwhile my side projects using GraphQL are just incredible, and I don’t want to kill myself after developing it.

    • expr
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      I wasn’t suggesting making JSON “REST” APIs (not actually REST, more accurately you might call them JSON data APIs or something). I meant protocols that are specifically meant for RPC, like gRPC, JSON-RPC, etc. Or message queues like RabbitMQ.