DEV Community

Discussion on: How to Serve On-Demand Streaming Videos from AWS (Build Your Own Netflix)

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦

The use-case you're describing is what we didn't cover in the talk due to time constraist. It was something we did have to solve.

CloudFront has a feature called Lambda@Edge which allows all incoming requests to pass through a Lambda function. So when a user requests to view content via our Rails app we generate out our own access token that uniquely identifies that user. We then pass than token along with the request to CloudFront, we ensure that we whitelist that header in the behaviours. We than use that token to validate that user against our database with that custom lambda function.

A single bucket solutions works great because its all our own content for a single platform. If lets say we had whitelabeled our LMS so multiple clients used it we could still use one bucket and lock down subdirectories to specific clients.