When I set out to build TopVideoHub, a video discovery platform covering 9 Asia-Pacific regions, I had to design an architecture that could fetch, store, and serve trending video data from Japan, South Korea, Taiwan, Singapore, Vietnam, Thailand, and Hong Kong — alongside the US and UK.
Here's how I built it with PHP 8.3, SQLite, and LiteSpeed.
Architecture Overview
The platform has three main components:
The Data Pipeline
Each region has its own fetch cycle. The fetcher runs on staggered cron schedules to distribute API quota usage:
Here's how I built it with PHP 8.3, SQLite, and LiteSpeed.
Architecture Overview
The platform has three main components:
- Data Pipeline — Cron-based fetcher that pulls trending videos from YouTube Data API v3 per region
- Storage Layer — SQLite database with FTS5 for multi-language search
- Serving Layer — LiteSpeed with three-layer caching for sub-100ms responses
The Data Pipeline
Each region has its own fetch cycle. The fetcher runs on staggered cron schedules to distribute API quota usage: