Mohamed Magdy Dewidar
View Repository
Distributed Systems & Event-Driven Architecture

Elevate Fitness: Event-Driven Microservices

A high-performance, event-driven ecosystem consisting of 8 microservices designed to handle high-throughput workout tracking and personalized content delivery. Built with .NET 9, it leverages asynchronous messaging and distributed caching to ensure massive scalability.

.NET 9RabbitMQ (MassTransit)RedisDocker ComposeSQL Server 2022CQRS (MediatR)Entity Framework Core

System Architecture

The platform utilizes a Database-per-Service pattern to ensure complete isolation. Services communicate asynchronously through a RabbitMQ Message Broker, while Redis provides a high-performance distributed cache for session state and read-heavy workout data.

Elevate Fitness Microservices Architecture

Solving the Dual Write Problem

Elevate Fitness App Main Screen

When a user starts a workout, the system must ensure the database update and the message publication happen atomically. I implemented the Transactional Outbox Pattern to capture events within the same transaction as the workout data, effectively eliminating the Dual Write Problem.

Guaranteed Delivery

By persisting events locally first, the system survives broker downtime, automatically retrying delivery until state is consistent across all services.

Redis Caching Strategy

Optimized read-heavy workout catalogs using Redis read-through caching, reducing SQL Server round-trips by up to 80% during peak activity.