引導式測驗 · 中等 等級
gRPC 與 REST 用於模型服務測驗
跨架構、序列化、串流、客戶端支援、相容性和端到端效能比較 gRPC 和 REST 樣式模型 API。
問題 1 的 8
How are gRPC service methods commonly described?
預覽每個問題8 問題
當您參加測驗時,就會出現答案和解釋。
- How are gRPC service methods commonly described?
- In an OpenAPI document describing HTTP paths and JSON schemas
- In a Protocol Buffers service definition with RPC methods and message types
- In a protobuf message schema without any service methods
- In generated client code with no source schema
- Which benefit makes JSON-over-HTTP practical for many public clients?
- It removes the need to define request and response fields
- It guarantees lower latency for model calls
- It has broad client and tooling support
- It avoids all serialization costs
- Which transport does gRPC commonly use?
- HTTP/1.1 with JSON as the required wire format
- HTTP/2 as its commonly used transport
- HTTP/3 as a requirement for every gRPC deployment
- A custom TCP transport unrelated to HTTP
- When may gRPC be a good fit for model serving?
- Typed contracts and streaming can suit compatible internal clients
- Any public client can call it without a compatible library or gateway
- It eliminates API versioning decisions
- It is useful only when inference runs on GPUs
- Why should the team benchmark both API options on real payloads?
- Serialization and network costs vary with payloads and client paths
- The API protocol determines the model prediction quality
- gRPC always uses less bandwidth for every payload
- Inference compute is independent of request shape
- What protects Protocol Buffer compatibility as schemas evolve?
- Compatibility is preserved by reusing removed field numbers
- Compatibility depends on preserving field-number and type rules
- Renaming fields requires changing their wire numbers
- Changing a field meaning is safe when its number stays fixed
- What should both API styles define for slow or repeated requests?
- Specify an unlimited retry policy for all failures
- Let clients wait without deadlines to avoid cancellations
- Define deadlines, error handling, authentication, and bounded retries
- Use different preprocessing for each transport without documenting it
- Which statement about REST is accurate?
- REST is an architectural style and does not mandate JSON encoding
- REST requires protobuf messages over HTTP/2
- REST cannot carry binary representations
- REST guarantees stateless model inference