TicketFlow use microservices architecture with API Gateway for entry and Kafka for event-driven communication.
- Role: Single entry for frontend.
- Connections: Routes HTTP requests to backend services via REST.
- Downstream:
- User Service (
:3001) - Event Service (
:3002) - Booking Service (
:3003) - Inventory Service (
:3004) - Payment Service (
:3005) - Notification Service (
:3006)
- User Service (
- Role: Asynchronous event backbone.
- Services Connected: All backend services except Gateway.
-
Key Topics & Flow:
-
ticketflow.user.registered$\rightarrow$ Notification Service -
ticketflow.booking.initiated$\rightarrow$ Inventory Service -
ticketflow.seats.locked$\rightarrow$ Booking Service -
ticketflow.payment.requested$\rightarrow$ Payment Service -
ticketflow.payment.processed$\rightarrow$ Booking/Inventory Service -
ticketflow.booking.confirmed$\rightarrow$ Notification Service
-
- User Service: PostgreSQL (
ticketflow_users) - Event Service: MongoDB (
ticketflow_events) - Booking Service: PostgreSQL (
ticketflow_bookings) - Inventory Service: PostgreSQL (
ticketflow_inventory) + Redis (Caching) - Payment Service: MongoDB (
ticketflow_payments) - Notification Service: MongoDB (
ticketflow_notifications)
-
User
$\rightarrow$ Gateway$\rightarrow$ Booking Service: Create booking request. -
Booking Service
$\rightarrow$ Kafka (ticketflow.booking.initiated). -
Inventory Service (consumes
booking.initiated)$\rightarrow$ Locks seats$\rightarrow$ Kafka (ticketflow.seats.locked). -
Booking Service (consumes
seats.locked)$\rightarrow$ Requests payment$\rightarrow$ Kafka (ticketflow.payment.requested). -
Payment Service (consumes
payment.requested)$\rightarrow$ Process payment$\rightarrow$ Kafka (ticketflow.payment.processed). -
Booking Service (consumes
payment.processed)$\rightarrow$ Confirms booking$\rightarrow$ Kafka (ticketflow.booking.confirmed). -
Notification Service (consumes
booking.confirmed)$\rightarrow$ Send email to user.