Service Communication Choices
Service Communication Choices
REST (HTTP/1.1 or HTTP/2) => Synchronous, High Coupling, JSON/XML payload, Good for External public APIs, web clients. ASP.NET Core Web APIs for REST.
gRPC (Google Remote Procedure Call) (HTTP/2) => Synchronous (streaming available), High Coupling, Binary (Protocol Buffers) payload, Good for Internal service-to-service. First-class support for gRPC natively within ASP.NET Core, optimizing it to run on top of Kestrel. Kestrel is a lightweight, cross-platform, and high-performance HTTP web server built natively for .NET.
Message Brokers
Message Brokers are Asynchronous, Decoupled via broker, Any payload, Good for Event-driven microservices, background tasks:
RabbitMQ is smart broker, dumb consumer. Uses a message queue routing messages using exchanges (Direct, Fanout, Topic) to specific queues. Open source.
Azure Service Bus is fully managed Azure version of RabbitMQ.
Amazon MQ implements RabbitMQ.
Amazon Simple Queue Service is serverless point-to-point queuing.
Amazon Simple Notification Service is serverless pub/sub.
Apache Kafka is dumb broker, smart consumer as a distributed append-only log. Outstanding for high-throughput event sourcing, real-time analytics, and building event-driven state tracking. Open source. Legacy way is Zookeeper. New way is Kafka Raft.
Amazon Managed Streaming for Apache Kafka is Amazon’s Kafka.
Amazon Kinesis Data Streams is real-time cloud data streaming.
Azure Event Hubs is fully managed Azure version of Kafka.
Apache Event Mesh is a cloud-native event infrastructure. Open source.
Azure Event Grids is a reactive routing engine for cloud events. Good for IoT.
Amazon Event Grids is a reactive routing engine for lots of event types via JSON rules.
Old Technology:
MSMQ (Microsoft Message Queuing) => old. asynchronous, point-to-point queueing. However, developers got pub/sub by building custom "distribution lists" or app-level routing layers. A publisher would send a message, and the app layer would duplicate and push that message into multiple distinct destination queues.
WCF (Windows Communication Foundation) and CoreWCF => old. handles synchronous and asynchronous messaging like gRPC.
MediatR => old. An in-process Mediator pattern implementation. Handles decoupled, asynchronous in-memory event handling and command dispatching within a single microservice boundary.
Comments
Post a Comment