Skip to content

Instantly share code, notes, and snippets.

@hanshoglund
Last active June 30, 2019 22:32
Show Gist options
  • Save hanshoglund/ccec10ce261497466a1542f1d7494408 to your computer and use it in GitHub Desktop.
Save hanshoglund/ccec10ce261497466a1542f1d7494408 to your computer and use it in GitHub Desktop.
RCP Stack.md
- Connection: TCP
- Framing/Call-Resp: HTTP1.1/2
- Encryption: TLS
- Auth
- Server: TLS certificate
- Client: JWT
- Serialization: JSON?
- Method name: Header/JSON frame
- Errors: Header/JSON frame
- Types/Introspection: TIDL/GraphQL?
- Minimization:
- Compression?/Format negotiation?
- Minimal fieldset/queries: GraphQL?
- Tag/schema exchange?
- Caching: hard in both due to unrestricted mutation (compare CAS/immutable IDs)
- Based on assumptions such as:
- A certain method is *pure* (calling the same method with the same arg gives the same result). Strong consistency.
- A certain method is *impure with infrequent updates* (calling the same method with the same args gives a result valid for some time). Weak consistency.
- In the precense of GraphQL style queries, certain queries will overlap and can reuse each other's results. Strong or weak consistency depending on the purity of the queries.
- Streaming: HTTP2/gRPC?
TBD
## Comparison
### GraphQL
Pros:
- Field minimization
- Single "query" operation (encouraging viewing state as an immutable object)
Cons:
- Bad unions (enum/interface/union), no tagged unions
- Scalars are all strings
- Assymetric input/output
### Protobuf
- All fields nullable
- No parametricity (only certain types composable etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment