Remote Procedure Calls
In this chapter, we split CodeDrill, a practice site for programming problems, into two services, and design the call from one service to the other as a remote procedure call.
After reading this chapter, you should be able to:
- Explain why running code belongs in a service separate from the rest of the application
- Decide whether the runner reads the tests or receives them with each call
- Explain why running code fits a resource-oriented REST API poorly, and define a remote procedure call
- Read a JSON-RPC request and response, and decide whether an outcome is a result or an error
- Explain what a client stub and a server stub do
- Choose how long to wait for the runner, and decide what happens to a submission when no results arrive
- Explain what gRPC offers compared with JSON-RPC
- Explain how tRPC checks a call against the server’s own types, and when it fits the API between a browser client and its server
- Choose between REST and RPC for an API