Barkat TV serves religious content to a global audience. When they approached us, their platform crashed during peak events—Friday prayers and religious holidays. They needed infrastructure that could scale dynamically and deliver video reliably worldwide.
Initial Challenges
The existing platform ran on a single server. During peak times, CPU hit 100%, streams buffered, and users abandoned the platform. There was no CDN, no load balancing, and video was served directly from the origin server.
Infrastructure Redesign
We migrated to a cloud-native architecture using AWS and Cloudflare. The new stack included:
-
Auto-scaling groups of EC2 instances behind application load balancers
-
CloudFront CDN for video content delivery from 400+ edge locations
-
S3 for video storage with lifecycle policies for cost optimization
-
ElastiCache (Redis) for session management and real-time chat
Video Delivery Optimization
We implemented HLS (HTTP Live Streaming) with adaptive bitrate. Users on slow connections received 480p streams; those on fast connections got 1080p. This prevented buffering and reduced bandwidth costs by serving appropriate quality levels.
Database Scaling
The original MySQL database became a bottleneck. We implemented:
-
Read replicas for analytics and reporting queries
-
Connection pooling via RDS Proxy to handle thousands of concurrent connections
-
Caching layers reducing database load by 70%
Real-Time Features
Live events needed real-time chat and donation tracking. WebSocket connections handled chat, while Server-Sent Events pushed donation notifications. We used Redis Pub/Sub to synchronize messages across multiple server instances.
Monitoring and Alerting CloudWatch
tracked CPU, memory, and network metrics. PagerDuty alerts notified engineers when latency exceeded thresholds. We established runbooks for common issues, reducing incident response time from 30 minutes to 5 minutes.
Disaster Recovery
Multi-region deployment ensured availability even if an entire AWS region failed. Automated backups with 1-minute Recovery Point Objective (RPO) meant minimal data loss. Regular failover drills validated our disaster recovery procedures.
Results
-
Scaled from 1,000 to 100,000 concurrent viewers
-
99.99% uptime during peak religious events
-
60% reduction in video delivery costs via CDN optimization
-
45% improvement in average stream start time
-
Zero downtime during the last 12 months
Lessons Learned
Load testing with realistic traffic patterns is essential. We initially underestimated chat message volume during peak events and had to implement message rate limiting. Caching strategies need constant refinement as content patterns change.
Conclusion
Scaling streaming platforms requires thinking beyond just video delivery. Barkat TV's success came from holistic infrastructure design—CDN, auto-scaling, database optimization, and real-time features working together. The result is a platform that serves communities reliably during their most important moments.
Tags:
case study
streaming
scalability
AWS
video platform