The Dynamic Movie Booking Insights Platform is a robust solution designed to process real-time movie ticket booking data and provide actionable insights. By leveraging Snowflake’s Dynamic Tables, Streams, Tasks, and integrated Streamlit, the platform delivers a seamless analytics experience. The interactive dashboard allows businesses to track revenue, ticket sales, and booking trends with ease.
-
Real-Time Data Processing:
• Tracks changes in booking data using Snowflake Streams and Tasks.
• Handles CDC (Change Data Capture) events like INSERT, UPDATE, and DELETE.
-
Dynamic Insights:
• Aggregates data in real-time using Snowflake’s Dynamic Tables.
• Provides metrics such as revenue, tickets sold, cancellations, and more.
-
Integrated Streamlit Dashboard:
• Hosted directly in Snowflake for a zero-setup experience.
• Offers filters for date range and booking status.
• Visualizes data through tables, metrics, and charts.
• Streams: For capturing changes in booking data.
• Tasks: To automate processing and aggregation of data.
• Dynamic Tables: To enable real-time analytics.
• Python Worksheets: For developing and running Python-based logic.
• For creating the interactive and responsive dashboard.
-
Log in to your Snowflake account.
-
Create a new worksheet.
-
Copy the content of the snowflake_dynamic_tables.sql file into the worksheet and execute it.
• This script creates:
• The database movies and required tables.
• Streams and tasks for processing CDC events.
• Dynamic tables for analytics.
-
Activate the tasks:
ALTER TASK ingest_cdc_events_task RESUME;
ALTER TASK refresh_movie_booking_insights RESUME;
-
Open a Python Worksheet in Snowflake.
-
Copy the contents of the streamlit_app.py file into the worksheet.
-
Click the Run button in the worksheet to ensure no errors occur.
-
Click the Streamlit button (usually located in the top-right corner of the worksheet) to launch the interactive dashboard.
• Date Range: Filter booking data by selecting a specific date range.
• Booking Status: Filter bookings by status (BOOKED, CANCELLED, COMPLETED, or all).
• Total Bookings
• Total Tickets Sold
• Total Revenue
• Revenue by Booking Status
• Tickets Sold by Status
• Bookings and Revenue by Movie
• Detailed revenue and booking data by movie or status.
Below is a preview of the interactive dashboard hosted in Snowflake Streamlit:
Link to Dashboard: https://app.snowflake.com/europe-west3.gcp/qv46679/#/streamlit-apps/MOVIES.PUBLIC.R2OC4N65TX1QZZ7F?ref=snowsight_shared
dynamic-movie-booking-platform/
│
├── snowflake_dynamic_tables.sql # Snowflake SQL script for database setup
├── streamlit_app.py # Streamlit app for the interactive dashboard
├── README.md # Project documentation
└── requirements.txt # Python dependencies
-
Data Ingestion.
• Booking data is inserted, updated, or deleted in the raw_movie_bookings table.
• The movie_bookings_stream captures CDC events (insert, update, delete).
-
Data Processing:
• The task ingest_cdc_events_task processes CDC events and stores them in movie_booking_cdc_events.
• Dynamic tables (movie_bookings_filtered and movie_booking_insights) aggregate and filter the data for analysis.
-
Visualization:
• The Streamlit app fetches data directly from Snowflake tables and visualizes it dynamically.
-
Snowflake SQL Components:
• Streams: movie_bookings_stream to track CDC changes.
• Tasks: ingest_cdc_events_task and refresh_movie_booking_insights for data processing and refreshing.
• Dynamic Tables:
• movie_bookings_filtered: Filters relevant booking data.
• movie_booking_insights: Aggregates key metrics and insights.
-
Streamlit Dashboard:
• Filters data based on user input (date range and status).
• Displays metrics, charts, and tables for easy analysis.
• Use machine learning models for demand forecasting and revenue prediction.
• Add authentication and role-based access control.
• Notify users about booking trends or anomalies.
• Provide an option to export data as CSV or Excel.
🚀 Experience seamless movie booking analytics directly within Snowflake!