AWS Service - Booking System Architecture

Introduction

In this article, we are going to look at a ticket booking system using AWS architecture that can utilize a few services such as Amazon Fargate for hosting the application, Amazon RDS for database management, Amazon API Gateway for managing API calls, AWS Lambda for serverless computing, and Amazon DynamoDB for fast and scalable data storage. This architecture ensures high availability, scalability, and efficient management of the ticket-booking process.

Conceptual Design

Infrastructure Design

Connectivity between Theatre vs Booking Platform

The connectivity between these two systems is through API calls. There are a few options, such as.

  • Designated rows of seats for platform users; In this case, we don't need to connect the theater system to update booking information.
  • Another strategic option is to get seat availability on the fly, In this case, the platform needs to check the availability of seats and then have to apply the lock-in concept for ~10 minutes duration to avoid a deadlock scenario.

Components to build the system

  1. Cluster 1: This API(s) is used to do the following works
    1. Booking Related API(s)
    2. Get Recommendation
    3. Content Creation
    4. Authentication using Cognito.
  2. Cluster 2: This API is used to connect to get on-demand seating availability and update the same once booking confirmation is done.
    1. Connector API

Infrastructure Components

Name Purpose
Application Load Balancer (ALB) The ALB is used to distribute the load on the server and keep the system highly concurrent when we are scaling the app server horizontally.
Elastic Container Service (ECS) ECS allows you to easily run and manage containers at scale in a highly available and secure environment. With ECS, you can deploy and manage Docker containers on a cluster of EC2 instances or by utilizing AWS Fargate, a serverless compute engine for containers.
Event Bridge Event Bridge is a serverless event bus service provided by Amazon Web Services (AWS). It enables seamless integration and communication between various AWS services, third-party SaaS applications, and custom applications. EventBridge allows you to route, process, and react to events in a scalable and decoupled manner, facilitating event-driven architectures and enabling real-time event-driven workflows and automation. It simplifies event-driven programming, reduces dependencies, and enhances the flexibility and extensibility of your applications and systems.
Kafka Kafka is an open-source distributed event streaming platform that provides a highly scalable and fault-tolerant system for processing and storing streams of records. It is designed to handle high-throughput, real-time data streaming use cases and allows applications to publish, subscribe, and process streams of events efficiently.
Step Functions Step Functions is a serverless workflow orchestration service provided by Amazon Web Services (AWS). It allows you to build and coordinate complex, multi-step workflows using a visual interface. Step Functions enables you to define and execute workflows as a series of steps, with support for error handling, retries, and parallel processing, making it easier to build and manage scalable and reliable applications.
AWS RDS (Relational Database Service) AWS RDS is a fully managed database service provided by Amazon Web Services. It simplifies the setup, operation, and scaling of relational databases such as MySQL, PostgreSQL, and Oracle, allowing you to focus on your application development without worrying about infrastructure management.
AWS Lambda AWS Lambda is a serverless computing service provided by Amazon Web Services. It allows you to run your code without provisioning or managing servers, automatically scaling based on incoming requests. Lambda supports a variety of programming languages and can be used to build event-driven, highly scalable, and cost-effective applications or services.
Dynamo AWS DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services. It offers high scalability, low latency, and automatic scaling to handle massive workloads and unpredictable traffic patterns. DynamoDB is a key-value and document database that provides fast and reliable performance, making it well-suited for applications that require low-latency data access and flexible scalability.
AWS Personalize AWS Personalize is a machine learning service offered by Amazon Web Services. It enables developers to create personalized recommendations for their applications, websites, and content. By leveraging machine learning algorithms and data provided by users, AWS Personalize can generate personalized recommendations for various use cases, such as product recommendations, content recommendations, and personalized search results, enhancing the user experience and engagement.
AWS Pinpoint AWS Pinpoint is a fully managed marketing and engagement service that Amazon Web Services provides. It helps businesses build and execute targeted, personalized, and multichannel marketing campaigns to engage with their customers. With pinpoint, businesses can send SMS, email, push notifications, and in-app messages to reach their customers effectively. Pinpoint also provides analytics and insights to track campaign performance and customer behavior, allowing businesses to optimize their marketing strategies and improve customer engagement.
Payment Gateway AWS Payment Gateway is a service provided by Amazon Web Services that enables businesses to securely process online payments. It offers a range of payment processing options, including credit cards, digital wallets, and alternative payment methods, making it easier for businesses to accept payments from customers while ensuring transaction security and compliance.
ELK (Elastic Search, Logstash, Kibana) This is used for the logging system. All the logs are pushed into the Logstash. Logstash collects data from all the servers.
Redis Cache Redis Cache is a fully managed, in-memory caching service provided by Amazon Web Services (AWS). It allows businesses to enhance the performance and scalability of their applications by storing frequently accessed data in a high-speed, distributed Redis cache. Redis Cache helps reduce database load, improve response times, and increase overall application performance by serving cached data from memory, resulting in faster data access and reduced latency.
CloudFront CloudFront is a global content delivery network (CDN) provided by Amazon Web Services (AWS). It helps businesses deliver their website content, videos, APIs, and other web assets to end-users with low latency and high data transfer speeds. CloudFront caches content at edge locations worldwide, reducing the load on origin servers and improving the overall user experience. It also provides advanced features like SSL/TLS encryption, DDoS protection, and dynamic content acceleration, making it an essential tool for optimizing content delivery and enhancing performance across the globe.
WAF It is a security service provided by Amazon Web Services (AWS) that helps protect web applications from common web-based attacks. WAF allows businesses to define and enforce customized security rules to filter and block malicious traffic, preventing attacks such as SQL injection, cross-site scripting (XSS), and distributed denial-of-service (DDoS) attacks. WAF integrates with AWS CloudFront and Application Load Balancers to inspect incoming traffic and apply security policies, providing an additional layer of protection for web applications hosted on AWS.


Technology Stack

  • User Interface: React and NodeJS
  • Server language and Framework: .NET Core, Minimal API
  • Design principles and patterns: SOLID, strangler fig pattern, Domain-Driven Design (DDD), Test-Driven Development (TDD)
  • API Documentation: Open API, Swagger
  • Security: AWS Cloud Security, JWT with Refresh Token Concept
  • Database: AWS RDS and Dynamo DB
  • Caching: Redis
  • Notifications: Confluence Kafka
  • Payment API: Razor for mockup
  • Deployment: Docker & Ansible
  • Code repository: Git
  • Logging: CloudWatch, S3
  • Log Management: ELK Stack
  • Load balancer: ALB

Logical Entry of User in Portal to Booking a Ticket

  1. A user enters the booking platform; based on the filter recommendation engine will show respective movies.
  2. Once the user selects the available seat, the seat will lock for ~10 minutes, and those seats won't be displayed or availed to other users.
  3. Once checkout, the unique booking id will be generated with default status. Please find the booking conversion status.
    1. Initial Status => Pre-Booking
    2. Payment =>
      1. Payment Initiated
      2. Payment Completed
    3. Completed => Booking Completed
    4. Invoiced => Invoice done
    5. Settlement Done => Internal Status to sync payment given to respective theater. It might be daily/weekly based on the contract between the theater and the booking platform.
  4. After the Invoice, the notification goes to the end-user through email or text based on the user message consent opt-in.
  5. Parallelly, the following details will be shared with the theater
    1. Seat Allocation
    2. Customer Data
    3. Booking Information
  6. Finally, the user just needs to show this booking id to get into the theater to enjoy the movie.

Conclusion

In conclusion, the theater booking platform design outlined in this article aims to revolutionize the way users discover and book movies. By leveraging technologies such as the cloud, recommendation engines, and payment gateways, the platform offers a seamless and personalized experience. From seat selection to ticket generation and entry management, every step is optimized for convenience and efficiency. With its user-friendly interface and comprehensive features, the theater booking platform design promises to enhance the overall movie-going experience for users.

Finally, I hope this article provides a few insights into the design of a theater booking platform.


Similar Articles