300-435 Question 19
Select 3You are designing an automation solution for a Cisco network and need to consume APIs from an external system. The external API supports both synchronous and asynchronous communication modes. Which challenges and patterns should you consider when deciding between these two approaches?
- A
Synchronous APIs can lead to increased latency if the external system takes longer to respond.
- B
Asynchronous APIs require additional mechanisms to handle callback responses or polling.
- C
Synchronous APIs are always preferred because they are simpler to implement and maintain.
- D
Asynchronous APIs can help avoid blocking processes, especially for long-running operations.
- E
Synchronous APIs ensure that data is processed in parallel, improving performance.
Show answer and explanation
Correct answers: A, B, D
Explanation
When choosing between synchronous and asynchronous APIs, it is important to consider the challenges and use-case-specific patterns for each approach. Synchronous APIs can introduce latency and blocking, making them unsuitable for long-running tasks. Asynchronous APIs, while more complex due to the need for callback mechanisms or polling, provide a non-blocking approach that is better suited for operations requiring high responsiveness or parallel execution. Understanding these trade-offs is crucial for designing an efficient and reliable automation solution.
- A. Correct.
Synchronous APIs can lead to increased latency because the client must wait for the server to process the request and respond, making this a challenge in certain use cases.
- B. Correct.
Asynchronous APIs require additional mechanisms, such as implementing callbacks or polling for responses, which can add complexity to the solution.
- C. Incorrect.
While synchronous APIs may be simpler in some scenarios, they are not always preferred. Their simplicity comes at the cost of potential latency and blocking issues.
- D. Correct.
Asynchronous APIs are designed to avoid blocking processes by allowing long-running operations to execute in the background, which is a key advantage in certain automation scenarios.
- E. Incorrect.
Synchronous APIs do not process data in parallel; they process requests sequentially, which can result in blocking operations and reduced performance.