rocicorp/replicache-old

Customer request: proxy batch request through diff-server

Closed this issue · 1 comments

See thread starting here:

https://app.slack.com/client/TMQQ9DWPQ/C0119JQT0PK/thread/C0119JQT0PK-1591734973.024200

There are various reasons to want to do this, some feasible some not:

  1. Not wanting to implement the batch endpoints's requirements

Moving some or all of this to the diff-server would break some of Replicache's correctness promises. Notably it is not possible to provably implement causal consistency unless data layer helps in some way similar to what is currently specified.

It may be worth it for some customers to lose these features in exchange for ease-of-implementation, but we should proceed cautiously.

  1. Wanting to reuse existing endpoint code as-is.

We cannot reuse existing RPCs because they do not implement Repliache's error requirements (retry vs non-retry). Developers would have to update their endpoints at least somewhat.

  1. Wanting to avoid publishing API server endpoint, for security reasons.

Diff-server would still require that batch server be addressable publicly on the internet. (at least unless diff-server can be arranged to be behind same private network at e.g., amazon). Thus only change is whether URL is published.


Resolution: there isn't currently sufficient rationale to make this change. But creating bug to aggregate feedback and additional rationale in support of it.

volyx commented

In ideal world I want to have two oppotunities:

  1. cloud diff-server with object browsing
Replicache replicache = new Replicache(token:"<TOKEN>")
// by default it connects to some replicache cloud - http://cloud.replicache.dev

In cloud panel you will add your server api - http://api.example.com/replicache-client-view, http://api.example.com/replicache-batch

Also you would have object browser in that panel for viewing objects:

  • todo1[name, id, completed, order]
  • todo2[name, id, completed, order]
  1. local installation
Replicache replicache = new Replicache(token:"<TOKEN>", host: "http://diff-server.example.com")

Here I'm running diff-server on my servers and passing the --client-api http://api.example.com/

Flutter developers work only with replicache isntance and know nothing about the server. Backend developers expose their objects only to diff-server