<HC />
Back to Projects
Cloud & Serverless ArchitectureArchived Learning Project

CineBook — Movie Ticket Booking Platform

A cloud-native movie ticket booking platform inspired by BookMyShow that guarantees atomic seat reservations using DynamoDB transactions (transact_write_items) and conditional expressions to eliminate double-bookings without database locks.

PythonFlaskGunicornAmazon DynamoDBAWS API GatewayAmazon EC2Amazon S3AWS IAMboto3MotoHTML5CSS3JavaScript

Screenshots

CineBook — Movie Ticket Booking Platform — Home Page
Home Page
CineBook — Movie Ticket Booking Platform — Movie Catalogue
Movie Catalogue
CineBook — Movie Ticket Booking Platform — Seat Selection
Seat Selection
CineBook — Movie Ticket Booking Platform — Booking Confirmation
Booking Confirmation

Key Metrics

Flask Gunicorn Backend on EC2 with API Gateway

Amazon DynamoDB (On-Demand)

DynamoDB transact_write_items

ConditionExpression attribute_not_exists

Moto Mock AWS Framework

Automated boto3 Setup Scripts

Overview

CineBook is a full-stack cloud-native movie ticket booking platform inspired by BookMyShow. The system allows users to browse movie listings, view showtimes, select seats interactively, and execute atomic ticket bookings. Built on AWS with Flask, Gunicorn, API Gateway, and DynamoDB, CineBook guarantees concurrency control without traditional SQL row locks.

Problem

Traditional movie reservation platforms rely on database row locks or heavy relational database transactions, creating latency bottlenecks during high-demand booking sales and introducing risks of double-booking under concurrent traffic.

Solution

Implemented atomic seat reservations in DynamoDB using transact_write_items operations guarded by conditional expressions (ConditionExpression="attribute_not_exists(seat_id)"). Competing requests for the same seat automatically fail with HTTP 409 Conflict, ensuring strict zero-lock concurrency control.

Architecture

Cloud-native architecture deployed across AWS services. An S3 static website hosts the interactive frontend, communicating through Amazon API Gateway to a Flask REST API running on an EC2 instance under Gunicorn. The backend interacts with DynamoDB Tickets tables using composite primary keys (show_id, seat_id) to perform atomic multi-seat transactions and manage movie showtime schedules.

Challenges

  • Designing atomic multi-seat reservation transactions in DynamoDB to eliminate double-booking risks during simultaneous seat selection.
  • Writing automated concurrency test suites that send 10 parallel HTTP requests for the same seat to verify 1 success and 9 HTTP 409 conflicts.
  • Automating the multi-service AWS infrastructure deployment (EC2, S3, API Gateway, IAM, DynamoDB) via Python and boto3 scripts.
  • Enabling offline backend development and unit testing without active AWS resources using the Moto AWS mocking library.

Lessons Learned

  • Concurrency control and atomic transaction modeling with Amazon DynamoDB transact_write_items.
  • Designing zero-lock REST APIs for high-concurrency ticket reservations.
  • Deploying Flask applications in production on EC2 with Gunicorn and API Gateway reverse proxying.
  • Automated cloud infrastructure provisioning using Python and the AWS SDK (boto3).
  • Mocking AWS cloud environments locally using Moto for rapid offline testing.

Future Improvements

  • Migration from EC2 to serverless AWS Lambda execution or AWS ECS Fargate containerization for auto-scaling.
  • Integration of Redis / ElastiCache for short-lived (5-minute) temporary seat reservations before payment completion.
  • Payment gateway sandbox integration (Razorpay / Stripe) for checkout processing.
  • Adding JWT user authentication and booking history management.