Posts

Handling Distributed Transactions In Microservices

Image
Contemporary thinking and development efforts are heavily focused on Microservices, and I am no exception. Microservices, at their essence and in their genuine context, constitute a distributed system. So, what exactly is a distributed transaction? Distributed Transactions refer to transactions that extend across multiple physical systems or computers connected via a network. In the realm of microservices, a transaction becomes distributed as it spans multiple services. These services are invoked in a specific sequence to collectively execute the entire transaction. Microservices architecture is known for its decentralized and independent nature, where applications are divided into smaller, loosely coupled services. One of the challenges in such an architecture is handling transactions, especially distributed transactions that involve multiple microservices. The traditional ACID properties (Atomicity, Consistency, Isolation, Durability) may become challenging to achieve in a distribute...

How .NET core API configure and communicate with Message Queues

Image
To enable communication between different components of the application or between separate services In .NET Core, we can configure and communicate with message queues . It provides a reliable and scalable way for different parts of a system to exchange information asynchronously. Common message queue systems include RabbitMQ, Apache Kafka, Azure Service Bus, and AWS Simple Queue Service (SQS). Let's explore a general outline of how to configure and communicate with a message queue in a .NET Core API:   1. Choose a Message Queue Provider: Select a message queue provider that suits your application requirements. Some popular options include: - RabbitMQ: A widely-used open-source message broker. - Apache Kafka: A distributed streaming platform. - Azure Service Bus: A fully managed message broker service in Microsoft Azure. - AWS SQS: A fully managed message queuing service in Amazon Web Services.   2. Install the Required NuGet Packages: Install the necessary NuGet packages f...