Designing Reliable, Scalable Messaging Architectures for Production
Chapter 1: Why Distributed Systems Matter
- The Inevitability of Distribution
- What Goes Wrong (and Often Does)
- The Cost of Getting It Right
- How This Book Is Structured
Chapter 2: Foundations of Distributed Systems
- The CAP Theorem (and What It Really Means)
- Consistency Models from Strong to Eventual
- Fault Tolerance and Failure Modes
- Reliability, Availability, Durability
- Idempotency as a Design Principle
Chapter 3: Messaging and Communication Patterns
- Synchronous vs Asynchronous Communication
- Point-to-Point and Queue-Based Messaging
- Publish/Subscribe and Event Streaming
- Request/Reply Patterns
- Event-Driven Architecture Fundamentals
Chapter 4: RabbitMQ Architecture and Core Concepts
- Installing and Configuring RabbitMQ
- Nodes, Clusters, and Topology
- Virtual Hosts and Namespaces
- Exchanges and Their Types
- Queues, Bindings, and Routing Keys
- The Message Lifecycle
Chapter 5: Python Clients and Connection Management
- Choosing Your Client Library
- Connection Parameters and Heartbeats
- Channel Management Best Practices
- Async vs Sync Clients
- Robust Reconnection Strategies
- Resource Cleanup and Graceful Shutdown
Chapter 6: Building Reliable Producers and Consumers
- Publishing Messages Correctly
- Consumer Acknowledgements and Nacks
- Publisher Confirms for Delivery Guarantees
- Message Durability and Persistence
- Prefetch Tuning and Flow Control
- Error Handling Patterns
Chapter 7: Advanced RabbitMQ Features
- Priority Queues for Critical Workloads
- Delayed and Scheduled Messaging
- Dead-Letter Exchanges and Retry Strategies
- Message Time-to-Live and Expiration
- RabbitMQ RPC Pattern Implementation
- Queue Arguments and Advanced Configuration
Chapter 8: Designing Robust Distributed Systems
- Retry Strategies with Exponential Backoff
- Circuit Breaker Pattern Implementation
- The Saga Pattern for Distributed Transactions
- Idempotent Consumer Design
- Message Ordering Guarantees
- Handling Duplicate and Out-of-Order Messages
Chapter 9: Project One - Production Task Queue System
- Requirements and Architecture Decisions
- Project Structure and Configuration
- Task Serialization and Schema Design
- Worker Implementation with Graceful Shutdown
- Retry Logic and Dead-Letter Handling
- Testing the Task Queue System
- Docker and Deployment Configuration
Chapter 10: Event-Driven Microservices with CQRS
- Microservice Communication via Events
- Implementing the CQRS Pattern
- Event Sourcing Integration Concepts
- Inter-Service Saga Orchestration
- Domain Events and Event Versioning
- Handling Schema Evolution
Chapter 11: Observability in Production
- Structured Logging for Distributed Systems
- Metrics Collection with Prometheus
- Distributed Tracing with OpenTelemetry
- Health Checks and Readiness Probes
- Debugging Message Flow Issues
- Correlation IDs Across Services
Chapter 12: Security, Authentication, and Authorization
- TLS/SSL Encryption End-to-End
- User Authentication and Password Policies
- Authorization and Access Control
- VHost Isolation Strategies
- Secrets Management in Production
- Network Security and Firewalls
Chapter 13: Deployment, Scaling, and High Availability
- Docker and Docker Compose Setup
- RabbitMQ Clustering Fundamentals
- Quorum Queues for High Availability
- Federation and Shovel Plugins
- Kubernetes Deployment Patterns
- Performance Tuning and Capacity Planning
Chapter 14: Production Pitfalls and Troubleshooting
- Memory Pressure and Flow Control
- Disk Alarms and Storage Management
- Diagnosing Consumer Lag
- Connection Storms and Resource Exhaustion
- Split-Brain Scenarios
- Systematic Troubleshooting Methodology