legion
legion copied to clipboard
gRPC to REST/OpenAPI based services
Summary
- Expose backend APIs that are accessible by all the different client types, standalone and web clients.
- Use a rust framework/crate that can ideally provide the following components:
- Code generation for both service and client based on an API contract.
- Easy to use and feature rich.
- Support for async/await.
- Compatible with our
tokio
runtime stack. - Potentially based on the HTTP client
hyper
we already use. - Ideally low amount of dependencies.
Current State
PROS
- Provides Rust code generation.
- Performant gRPC protocol based on protobuf (binary message format).
CONS
- Different protocols for web (grpc-web on HTTP/1.1 & 2) and standalone clients (HTTP/2) (need two load balancers).
- Rust gRPC implementation
tonic
is powerful but complex.
Tasks
- [x] #1526
- [x] #1529
- [ ] #1525