Comment by ochiba

2 years ago

The route that we went with for PowerSync (disclosure: co-founder) is to allow to define your own function for handling writes, where you would use your (presumably existing) backend application API to persist the writes to Postgres. Therefore you can handle any validation/authZ/business logic for writes in your backend layer.

The PowerSync client SDK still handles the queueing and retrying of writes so that they can be automatically retried if network connectivity is not available — whenever there is a retry, your callback function is called. (As a result of this approach, your write function should be idempotent; we commend using GUIDs or UUIDs generate client-side for primary keys)

Similar to Electric, PowerSync also uses JWT for auth against your backend.

There are some architecture diagrams explaining this on our docs root here: https://docs.powersync.co/

Can you please stop posting as much about PowerSync on a Show HN thread centered on ElectricSQL?

You are really taking the expression `shameless plug` to another level in this thread, aren't you?

  • Genuinely excited about this space and it's what I'm focused on full-time so definitely have thoughts to share. I am wary of self-promotion. I do want to contribute things that I feel are relevant to the discussion, since I assume folks would be interested to see different patterns/approaches around local-first/offline-first architecture.

    • > Genuinely excited about this space

      You can only be genuinely excited if you don't need to add a link to your product when talking about it. This one was actually your most interesting reply, I shouldn't have posted about the high amount of mention to your own competitor project here.