Fabflix

UCI CS 122B · Winter 2026 · Team of two (with Songhao Gao)

A movie-browsing and checkout web app, finally deployed as services on a Kubernetes cluster on AWS

Stack

Java Servlets, Tomcat, MySQL, JDBC, Redis, Docker, Kubernetes, AWS, JavaScript / HTML / CSS, Flamingo toolkit (edrec), reCAPTCHA, JMeter

Goal and outcome

Fabflix is a movie store web app. Customers log in, browse and search movies and stars, and check out a shopping cart; employees use a separate dashboard to add movies and stars.

We built it in five course projects, each adding a layer: core pages → login and cart → data import and security (reCAPTCHA, HTTPS, password encryption) → scaling and search (connection pooling, MySQL master/slave replication, full-text and fuzzy search) → containers and Kubernetes.

The final version (Project 5) is split into a login service and a movies service that share sessions through Redis, running on a Kubernetes cluster on AWS.

Watch the demoProject 5 demo video (recorded by me)YouTube · opens in a new tab

My role

The split below comes from the Contribution lists for each project in our team README.

My work

  • Data import: rewrote the program that loads six CSV files into MySQL and wrote up its performance report (Project 3; Problem 1 below).
  • Deployment: containerized Fabflix with Docker, set up a Kubernetes cluster on AWS, and wrote fabflix.yaml and ingress.yaml to run the app on it (Project 5).
  • Database and search: MySQL master/slave replication, fuzzy search and title autocomplete (Project 4; fuzzy search is Problem 2).
  • Security: reCAPTCHA on the employee dashboard login, and HTTPS (Project 3).
  • Customer flow: login page and login filter, shopping cart, payment and confirmation pages (Project 2); movie list and single star pages (Project 1).
  • Recorded the demo videos for Projects 2, 3 and 5 and tested for bugs.

Shared with my teammate

  • Restructured the app into a login service and a movies service, with sessions stored in Redis so either service can validate a login from any pod (Project 5). My teammate also helped get it running on the cluster.

Songhao Gao's work (not mine)

  • JDBC connection pooling and JMeter testing; the employee dashboard; password encryption; full-text search; reCAPTCHA on customer login; movie list sorting, pagination, search and browsing; the single movie page; README editing and debugging.

Project 5: Fabflix on Kubernetes (AWS)

Browser

Ingress (ingress.yaml)

Login service

/api/login, /api/dashboard/login

Movies service

Browsing, search and autocomplete, cart and checkout, employee dashboard, static pages

Redis

Customer and employee sessions, 24 h TTL, shared by both services

MySQL

Customer accounts, movies, stars and other app data

Project 5 service layout, drawn from the service list in the team README. I built the Docker image, the cluster and the manifests; the service split was joint work.

Technical problems

Problem 1: Loading the movie dataset took 8.5 minutes

Problem
The loader imports six CSV files (genres, stars, movies, ratings and two link tables) into MySQL. The first version did, for every row, a SELECT to check for duplicates, another SELECT to check foreign keys, and then an INSERT. A full load took 507.8 s, and stars.csv alone took 384.5 s. Every row cost several database round trips, and CPU usage reached about 85%.
What I did
  • Optimization 1: before loading, read the keys already in the database into in-memory lookup tables (hash sets and maps) once, then check duplicates and foreign keys against memory instead of querying per row. Total time dropped to 21.5 s.
  • Optimization 2: for the large, insert-heavy files, group INSERTs into JDBC batches so many rows share one round trip. Total time dropped to 4.74 s.
Why this approach
The bottleneck was the number of round trips, not the queries themselves. This task had no memory limit, so trading memory for fewer queries was the direct fix; batching then removed most of the remaining per-row round trips.

Total time to import the same dataset, by loader version (seconds)

  • Baseline507.8 s

    Per-row SELECT for duplicates + SELECT for foreign keys + INSERT

  • Optimization 121.5 s

    Existing keys preloaded into memory; checks run against memory

  • Optimization 24.74 s

    Optimization 1 plus batched JDBC INSERTs

Per-file timings (ms)
FileBaselineOptimization 1Optimization 2
genres.csv284155118
stars.csv384,5254,264722
movies.csv77,1632,553486
ratings.csv1,087398100
genres_in_movies.csv6,3572,178336
stars_in_movies.csv38,17110,4991,323
Total507,77221,4984,736

Totals are the loader's own end-to-end timer, which includes setup work outside the six per-file timers, so they are slightly larger than the sum of the rows.

Total time to import the same dataset with each loader version, measured in the same environment. Numbers from the README's CSV Loading Performance Report. This covers the CSV import only, not page or search latency.

Problem 2: Typo-tolerant search for multi-word titles

Problem
Users misspell titles. Comparing the query with the whole title by edit distance fails for multi-word titles: “Lovee” is far more than 2 edits from “A Love Story”, even though that is clearly the movie the user wants.
What I did
  • Combine three strategies with SQL UNION: the existing full-text search, LIKE for substrings, and edrec from the Flamingo toolkit, which compares the query with each word of the title.
  • Make the edit-distance threshold depend on query length: 1 for queries up to 4 characters, 2 for medium length, 3 for 8 characters or more.
  • Used in both title autocomplete (MovieTitleSuggestion) and the main search (MovieListServlet).
Why this approach
Users often type just one word of a title, and edrec's word-by-word comparison matches that. The length-based threshold was chosen for performance and usability: short queries stay strict, while longer queries tolerate more typos.

Results and verification

Original import time
507.8 s
After both optimizations
4.74 s
Faster overall
≈107×
  • CSV import: 507.8 s → 21.5 s → 4.74 s. How it was verified: the loader times each file and the whole run; all three versions ran on the same dataset in the same environment, and the per-file results are recorded in the README's performance report (see Evidence).
  • The slowest file, stars.csv, went from 384.5 s to 0.72 s; in-memory lookups alone (Optimization 1) already brought it to 4.26 s.
  • Deployment: the Project 5 version was deployed on the AWS Kubernetes cluster as separate login and movies services; the Project 5 demo video above is the team's recorded demonstration of this version.

Limitations

  • The 4.74 s figure is for the CSV import only; it says nothing about page or search response times.
  • The code is in a private GitHub Classroom repository, so the link may not open without course access. The README is published here as a public copy.
  • The multi-service restructuring was joint work, not mine alone.

Evidence