200-901 Question 51
Single answerA development team is designing an API for a financial application that processes transactions. The team needs an API style that ensures immediate confirmation of whether a transaction was successful or failed, without requiring the client to poll for updates. Which API style is most appropriate for this use case?
- A
REST with asynchronous communication
- B
REST with synchronous communication
- C
RPC with asynchronous communication
- D
RPC with synchronous communication
Show answer and explanation
Correct answer: B
Explanation
REST with synchronous communication is the best choice for a financial application where immediate confirmation of transaction success or failure is required. Synchronous communication involves the client waiting for a response to the request, making it suitable for scenarios where real-time feedback is essential. While synchronous RPC could also work, REST is often preferred for its simplicity, standardization, and better tooling support.
- A. Incorrect.
REST with asynchronous communication does not provide immediate confirmation because it requires the client to poll or wait for a separate callback to determine the transaction status.
- B. Correct.
REST with synchronous communication is suitable because the client sends a request and receives an immediate response, which meets the requirement for immediate confirmation of the transaction status.
- C. Incorrect.
RPC with asynchronous communication, like REST asynchronous, requires additional mechanisms for the client to receive updates and is not ideal for ensuring immediate confirmation.
- D. Incorrect.
RPC with synchronous communication could also provide immediate confirmation, but REST is generally preferred over RPC for modern web-based APIs due to its simplicity and widespread adoption.