How to Choose Between Synchronous and Asynchronous Integrations
An application integration can be synchronous or asynchronous. Learn when to create an asynchronous integration, a synchronous integration, or a combination of both.
What Kind of Application Integration Should You Design?
You have several options for application integrations: They can be synchronous, asynchronous, or a combination. When you know you need an application integration, the following decision tree helps you choose the type of application integration.
Detailed Explanation
The following table walks you through the questions in the previous decision tree and provides additional context for the questions and answers.
Question and details | Examples | Next steps |
---|---|---|
Do you need an immediate response? Sometimes, the client application that starts the integration requires an immediate response. |
No, I don't need an immediate response If you're updating a record in an application, you typically don't need an immediate response. For example:
Yes, I need an immediate response
|
No, I don't need an immediate response Create an asynchronous integration. You can stop reading here. Yes, I need an immediate response Go to the next question. |
Will everything finish running in seconds? Synchronous integrations should finish in milliseconds or seconds. Asynchronous integrations are better suited to more complex or longer-running integrations, such as integrations that must process hundreds of records. To make this decision, draw upon your and your coworkers' experience with building integrations. If everyone is new to building integrations, consider building the integration, testing it under real-world circumstances, and checking the integration's performance in the activity stream. If the integration's running time is too long, you can always move some of the logic into a separate synchronous integration. |
No, the integration can't run in seconds Consider an online retailer that collects all orders in a single file. One time per day, they run an integration that loops through the orders and processes them. The processing work includes validation, enrichment, and posting to an order-processing application. This integration takes several minutes to run. Yes, the integration can run in seconds Consider a bank that lets customers check their bank balances in a mobile app. The customers want to know their balances immediately, not in a minute or two. |
No, the integration can't run in seconds Create a synchronous integration that provides an immediate response, and use it to run an asynchronous integration that performs the longer or more complex task. For example, when a synchronous integration provides a customer with an order confirmation number, the synchronous integration can kick off an asynchronous integration that completes the remaining order-related tasks, including creating an account for the customer, registering the customer for marketing emails, updating inventory, and generating a packing list, and sending the packing list to the warehouse. Yes, the integration can run in seconds Go to the next question. |
Do you need to retry if a failure occurs? Integration failures typically occur when the client application that the integration connects to goes down. Synchronous and asynchronous integrations handle failures differently:
|
No, I don't need to rerun the integration Rerunning an integration doesn't make sense for the following situations:
Yes, I need to rerun the integration Reunning an integration makes sense for the following situations:
|
No, I don't need to rerun the integration Create a synchronous integration. Yes, I need to rerun the integration Create a synchronous integration that provides an immediate response, and use it to run an asynchronous integration that contains the actions that you need to rerun. |