5 ms·
GRPC is compact; in some cases it's important. What would you suggest, beyond the standard "ReST" and GraphQL, with OpenAPI as a declarative description?
by nine_k 3y ago
GRPC is compact; in some cases it's important.
What would you suggest, beyond the standard "ReST" and GraphQL, with OpenAPI as a declarative description?
- rattray 3y agoFor a compact message format being sent to browsers, you might look at messagepack, eg with https://github.com/msgpack/msgpack-javascript https://github.com/msgpack/msgpack-javascript – it's essentially binary JSON, so it'd be compatible with OpenAPI specs. I think the ser/des is slower than JSON in most browsers, but the message format is smaller. Oftentimes, using a query parameter like `?exclude[]=…` or `?include[]=…` or similar to say "only get me these response fields, not the whole object" can be useful for this too (and then you still get JSON back).