In synchronous communication the caller waits for the response to arrive within some expected timespan. Typical examples would be HTTP based protocols like REST or GraphQL. The request-response model forces the client to handle errors immediately and implement countermeasure techniques (like retries) to become available and operational. This kind of inter-service communication often makes for tightly coupled systems but they are easy to implement and well understood.
In asynchronous communication between systems, the caller sends a message and continues with its other tasks not waiting for the answer. When the response eventually arrives it handles it as any other arriving message. It is in contrast with synchronous communication where the caller waits for the answer. The asynchronous communication could be realized using an asynchronous framework like Akka Cluster, or by using some external component like Kafka, Pulsar or RabbitMQ.
Synchronous systems are well understood and easy to implement. You either get an answer in a timely manner or you need to handle an error, which is easy to reason about.
Synchronous communication doesn't require additional components (like message brokers) to handle communication, so there is no extra complexity of deploying and operating additional components..
Consumers and producers are by definition decoupled. The message broker sitting between the services makes it possible for the services to not know about each other while handling all the routing and persistence of messages.
Decoupled services work independently and failure in one doesn’t cause a failure in another. The client of the service won’t be immediately affected. This makes it easier to achieve high-availability of mission-critical systems.
Asynchronous services tend to consume less resources and components in microservices architecture tend to do one thing only. These facts combined with sharding at the message broker level make asynchronous messaging integrations the most viable option for scaling.
Probably every company uses synchronous communication of some sort.
We will reach out to you in less than 48 hours
to talk about your needs.
We will perform a free tech consultation
to see which stack fits your project best.
We will prepare the project estimate in 3 days
including the scope, timelines, and costs.
We'll get back to you soon!