DEV Community

Bulat Gabdrakhmanov
Bulat Gabdrakhmanov

Posted on

Microservices 101: Communication between services

Microservice architecture consists of multiple independent services that often need to communicate with each other.

This communication can be achieved in two primary ways:

  • Synchronous
  • Asyncronous

Synchronous communication

Image description

Synchronous communication follows a client-server model, where one service sends a request to another and waits for a response before proceeding.

Common protocols

  • REST APIs – resource-based communication using HTTP methods (GET, POST, PUT, DELETE)
  • RPC - Remote Procedure Call. Allows invoking methods on remote services as if they were local. Examples:

    • SOAP - XML-based
    • gRPC - uses binary format for payloads, high performance,

Pros & Cons

Pros:

  • Simple to use and implement
  • Immediate data retrieval

Cons:

  • Tightly coupled - if one service depends on another that is down, the entire operation fails
  • Scalability issues - high traffic can overload serivces
  • Latency - slow response times can create bottlenecks

Use cases

  • External API calls
  • Need immediate response (e.g. authentication)
  • Data consistency is critical (e.g. order processing)

Asynchronous communication

Image description

Asynchronous communication uses message brokers as an intermediate service for communication between services. Instead of waiting for an immediate response, a service sends a message to a broker, which another service later processes.

Pros & Cons

Pros:

  • Loosely coupled - services operate independently, improving scalability
  • High availability and resilience - a service can continue operating even if other services are temporarily down

Cons:

  • Increased complexity and maintenance - requires additional infrastructure and message handling
  • Messages ordering & duplication - messages may arrive out of order or be duplicated, requiring deduplication strategies

Use cases

  • Event-driven architecture
  • Background processing - immediate response is not required
  • High-load systems - where scalability is a priority

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up