Welcome to the Event Management and Ticket Booking Platform! This project is a robust implementation of microservices concepts and serves as a learning and practical exercise in building scalable, reliable, and maintainable systems.
- Introduction
- Technologies and Tools
- Microservices Architecture
- Key Microservices Concepts
- Services Overview
- Configurations and Deployment
- Scalability, Reliability, and Consistency
This platform enables users to register, book tickets, manage events, and provide feedback. Each functionality is handled by independent services communicating via both synchronous (REST/gRPC) and asynchronous (Kafka) methods. The system ensures reliability, scalability, and eventual consistency while showcasing advanced microservices patterns.
- Node.js (User, Event, Notification Services)
- Java (Ticket Service)
- Golang (Feedback Service)
- Python (Flask) (Analytics Service)
- MongoDB (User, Event Services)
- MySQL (Ticket Service)
- CockroachDB (Feedback Service)
- PostgreSQL (Analytics Service)
- Kafka (Messaging Broker)
- Kong Gateway
- REST to gRPC conversion
- JWT Authentication
- Custom Plugins (JWT2HEADER, Error Handling)
- Docker (Containerization)
- Docker Compose (Deployment)
- EmailJS (Email Notifications)
The project adheres to key microservices principles:
- Independent Deployment: Each service is containerized and deployed separately.
- Database per Service: Each service has its own database, ensuring data autonomy.
- Service Discovery: Managed via Kong Gateway.
- Communication:
- Synchronous: REST and gRPC for real-time requests.
- Asynchronous: Kafka for event-driven messaging.
- Scalability: Horizontal scaling enabled by containerization.
- Fault Isolation: Issues in one service do not propagate to others.
- Kong Gateway handles:
- REST to gRPC conversion using proto files.
- JWT-based authentication with custom plugins for enhanced functionality.
- Kafka ensures eventual consistency and reliable communication:
- Topics include
ticket-event
,ticket-status-event
,visit-event
,upsert-data
, andfeedback-event
.
- Topics include
- Choreography-based Saga:
- Ticket Service initiates booking/cancellation.
- Event Service adjusts seat availability.
- Feedback and Notification Services respond based on ticket status.
- Functionality: User registration, authentication, and profile management.
- Communication:
- Publishes changes to
upsert-data
topic. - Uses JWT for authentication.
- Publishes changes to
- Technology: Node.js, MongoDB
- Functionality: Event creation, seat management.
- Communication:
- Listens to
ticket-event
for booking/cancellation. - Publishes to
ticket-status-event
andupsert-data
.
- Listens to
- Technology: Node.js, MongoDB
- Functionality: Ticket creation and transaction management.
- Communication:
- Initiates messages to
ticket-event
. - Listens to
ticket-status-event
for Saga completion.
- Initiates messages to
- Technology: Java, MySQL
- Functionality: Event feedback recording.
- Communication: Publishes to
feedback-event
. - Technology: Golang, CockroachDB
- Functionality: Sends booking/cancellation confirmations.
- Communication: Listens to
ticket-status-event
. - Technology: Node.js
- Functionality: Generates analytics and reports.
- Communication: Listens to all topics for comprehensive data.
- Technology: Python-Flask, PostgreSQL
-
Kong Gateway:
- Routes and plugins configured via Kong Admin APIs.
- Custom plugins:
- JWT2HEADER: Extracts JWT claims to headers.
- Error Handling: Maps gRPC errors to appropriate HTTP status codes.
-
Kafka Setup:
- Topics created for event-driven messaging.
- Zookeeper for Kafka coordination.
-
Docker Compose:
- Service Orchestration: All services, databases, Kafka, and Zookeeper are orchestrated using Docker Compose.
- Volume Management: Persistent storage is enabled for Zookeeper and Kafka logs.
- Health Checks: Defined for Kong to ensure availability.
- Horizontal scaling supported via Docker.
- Independent scaling of services based on load.
- Kafka ensures at-least-once message delivery.
- SAGA pattern ensures consistent distributed transactions.
- Eventual consistency achieved through asynchronous messaging.
- Each service handles its own database updates and publishes events for others to synchronize.
- Monitoring & Logging Integration: Integrate Prometheus and Grafana for advanced monitoring and logging capabilities.
- Kubernetes Orchestration: Transition to Kubernetes for service orchestration, utilizing pods and clusters for enhanced scalability.
- CQRS and Event Sourcing: Implement CQRS and Event Sourcing patterns using Kafka and Debezium for more robust data handling.
- Circuit Breaker: Introduce circuit breaker patterns to improve fault tolerance and prevent cascading failures.
This project showcases a highly modular, scalable, and reliable microservices architecture. By integrating various microservices patterns and tools, it demonstrates best practices for real-world applications. Dive into the code to explore and enhance the platform!