Coding & Development Advanced Audience: Enterprise Architects, Senior Backend Engineers, Distributed Systems Leads

Event-Driven Microservices Architecture with RabbitMQ / Kafka / Redis

Design decoupled, event-driven microservices architectures featuring publisher/subscriber patterns, idempotency, and saga transactions.

#microservices#event-driven#kafka#rabbitmq#pubsub

System Directive • Copy and Paste Below

Act as a Chief Systems Architect specializing in event-driven distributed microservices architectures and asynchronous messaging.

Design an event-driven architecture for the following business workflow to replace a synchronous, tightly coupled monolith.

### SYSTEM SPECIFICATIONS:
- Business Workflow: [WORKFLOW_NAME_E_G_ECOMMERCE_CHECKOUT_USER_ONBOARDING]
- Microservices Involved: [LIST_OF_MICROSERVICES]
- Message Broker Preference (RabbitMQ, Apache Kafka, AWS SQS/SNS, Redis Streams): [MESSAGE_BROKER]
- Eventual Consistency Tolerance & Transaction Guarantees: [CONSISTENCY_REQUIREMENTS]

### ARCHITECTURAL BLUEPRINT:
1. **Event Schema & Contract Definitions (CloudEvents Specification)**:
   - Structured JSON event payloads for key domain events (e.g. `OrderPlaced`, `PaymentProcessed`, `InventoryReserved`, `NotificationSent`).
   - Defining: `event_id`, `timestamp`, `aggregate_id`, `version`, and `payload`.
2. **Topic & Exchange Routing Topology**:
   - Publisher / Subscriber routing rules (Direct, Fanout, or Topic exchanges in RabbitMQ, or Partition keys in Kafka).
3. **Distributed Transaction Management (The Saga Pattern)**:
   - Choreography vs Orchestration Saga implementation for handling multi-service rollback (e.g. if payment succeeds but inventory reservation fails).
4. **Idempotent Consumer Implementation**:
   - Code pattern showing how worker services safely process duplicate messages without double-executing side effects.
5. **Dead Letter Queue (DLQ) & Poison Pill Protocol**:
   - Automated routing of corrupted messages to a DLQ with exponential retry backoff and monitoring alerts.

Customization & Placeholders

Specify your microservices and message broker. The architecture includes Saga rollback patterns to preserve data consistency.

Example Input Values

Workflow: Order Checkout, Services: Order Service, Payment Service, Inventory Service, Email Service, Broker: RabbitMQ.

Expected Output Structure

CloudEvents JSON schemas, RabbitMQ exchange topology, Saga compensation transaction flow, and Python/Node consumer code.

Event-Driven Systems & Microservices

Qubenix decouples complex enterprise architectures into high-throughput, event-driven microservices with zero single points of failure.

Consult Systems Architects

More Prompts in Coding & Development

Coding & Development Intermediate

React & TypeScript Clean Component Architecture & State Management

Architect clean, maintainable React 19 / TypeScript components using compound patterns, custom hooks, and zero re-render bloat.

You are a Principal Frontend Architect specializing in React, TypeScript, and modern component design systems. Refactor or design the following React component into a production-grade, highly maintai...
#react#typescript#frontend
View Page →
Coding & Development Intermediate

Enterprise REST & GraphQL API Schema Designer with OpenAPI Specs

Design clean, pragmatic RESTful endpoints or GraphQL schemas adhering to OpenAPI 3.1 standards, pagination, and status codes.

You are a Principal API Architect who designs industry-standard, developer-loved APIs (following Stripe and GitHub design standards). Design a robust, comprehensive API specification for our applicat...
#api-design#rest#graphql
View Page →