(ARC303) Pure Play Video OTT: A Microservices Architecture
- 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Alex Smith, ASEAN Media Solutions Architect, AWS
Vidhya Narayanan, Director, Verizon onCue
October 2015
Pure Play Video, Over-The-Top
A Microservices Architecture in the Cloud
ARC303
- 3. Your Consumers Have Changed
More content choices
More devices
More delivery methods
New experiences
- 4. Your Business Has Changed
More data
Faster go to market
Leaner teams
Innovation and failure
- 5. What to Expect from the Session
Content is king
Building from scratch
Battle-hardened lessons – Verizon onCue
- 17. Storage and Ingest — Serverless
AWS Import/ Export
S3 Ingest
Lifecycle
policies
S3 bucket
Amazon Glacier
Content
provider
Lifecycle
policies
S3 IA
- 18. Storage and Ingest — Serverless
AWS Import/ Export
S3 Ingest
S3
notification
AWS Lambda
Lifecycle
policies
S3 bucket
Amazon Glacier
Content
provider
Lifecycle
policies
S3 IA
- 19. Storage and Ingest — Serverless
AWS Import/ Export
S3 Ingest
S3
notification
AWS Lambda
Metadata
extract & persist
Amazon
DynamoDB
Amazon
CloudSearch
S3 bucket
Amazon Glacier
Content
provider
Lifecycle
policies
Lifecycle
policies
S3 IA
- 20. Storage and Ingest — Serverless
AWS Import/ Export
S3 Ingest
For source, renditions, metadata sidecar files
S3
notification
Amazon Elastic
Transcoder
proxy / thumbnail
generation
AWS Lambda
Metadata
extract & persist
Amazon
DynamoDB
Amazon
CloudSearch
S3 bucket
Amazon Glacier
Content
provider
Lifecycle
policies
Lifecycle
policies
S3 IA
- 21. Storage and Ingest — Serverless
AWS Import/ Export
S3 Ingest
For source, renditions, metadata sidecar files
API Gateway
CloudFront
distribution
S3
notification
Amazon Elastic
Transcoder
proxy / thumbnail
generation
AWS Lambda
Metadata
extract & persist
Amazon
DynamoDB
Amazon
CloudSearch
AWS Lambda
S3 bucket
Amazon Glacier
Content
provider
Lifecycle
policies
Lifecycle
policies
S3 IA
- 26. Content Processing Pipeline (Using Lambda)
AWS Import/ Export
S3 Ingest
S3 as backend storage for content files accessible
to other processing tasks
Amazon Elastic
Transcoder
S3 notification
Trigger a Lambda
function to start a
transcoding job
Ingest
- 27. Content Processing Pipeline (Using Lambda)
AWS Import/ Export
S3 Ingest
S3 as backend storage for content files accessible
to other processing tasks
Amazon Elastic
Transcoder
S3 notification
Trigger a Lambda
function to start a
transcoding job
Ingest
S3 notification
- 28. Content Processing Pipeline (Using Lambda)
AWS Import/ Export
S3 Ingest
S3 as backend storage for content files accessible
to other processing tasks
Amazon Elastic
Transcoder
S3 notification
Trigger a Lambda
function to start a
transcoding job
Ingest
S3 notification
Lambda function to
extract metadata
Update CMS or
metadata
- 29. Content Processing Pipeline (Using Lambda)
AWS Import/ Export
S3 Ingest
S3 as backend storage for content files accessible
to other processing tasks
Amazon Elastic
Transcoder
S3 notification
Trigger a Lambda
function to restart a
transcoding job
Ingest
S3 notification
Lambda function to
extract metadata
Update CMS or
metadata
API Gateway
- 30. What About Packaging?
All moving towards HTTP –
RTMP is hard to scale
Battle of the standards –
HLS, HDS, SmoothStream,
MPEG-DASH
Alliance for Open Media
- 31. And Encryption / DRM?
Still largely driven by studio
requirements
Just-in-time encryption (hard)
Reusability across packaging
methods (PlayReady across
HLS & SmoothStream)
- 32. Pitfalls of Content Prep
Betting big on closed
standards
Technologies in vogue
Adoption is device-driven
- 33. Avoiding Pitfalls of Content Prep
Keep your mezzanine / masters (S3 IA, Glacier)
Mix and match your encoding
Contradictory — JIT packaging and heavy caching
Remember 80/20 (95/5) rule of content
- 36. Live
RTMP ingest to origin
Repackaged and encrypted on
the fly
DRM less common
WebRTC for 1-to-few, then
RTMP/HTTP when traffic
increases
Content Delivery Architectures
VOD / Catchup
File-based – stored on S3/CDN
Usually prepared
(encrypted/packaged) before final
storage
DRM by default
ISPs worried about unicast
delivery
- 37. HTTP Live Streaming (HDS & HLS)
HLS was pretty close to de facto
Space becoming disrupted again
Network considerations in the real world
- 38. HLS and HDS
Uses “parent / child / chunk”
model
HLS: Playlist contains
chunklists, which contain
chunks
HDS: Manifest contains
bootstrap files, which contain
fragments
- 39. HTTP Dynamic Streaming — HDS
> GET /live/channel1.abst HTTP/1.1
< Seg1-Frag55
< Seg1-Frag56
[…]
> GET /live/channel1.abst HTTP/1.1
< Seg1-Frag1
< Seg1-Frag2
- 40. HTTP Dynamic Streaming — HDS
Use fragment name alignment in the event of a republish
Ensure that fragments are aligned across bitrates
Players will error otherwise
- 41. Top Tip
HDS bootstraps are binary
To view, you must decode
them first
https://bitly.com/abstdecoder
(Thanks SwiftServe!)
- 42. HTTP Live Streaming — HLS
> GET /live/channel1.m3u8 HTTP/1.1
< HTTP/1.1 200 OK
< Date: Tue, 15 Sep 2015 13:37:56 GMT
< Server: Apache
< Last-Modified: Mon, 03 Aug 2015 3:14:15 GMT
< Accept-Ranges: bytes
< Content-Length: 219
- 43. HTTP Live Streaming — HLS
> GET /live/channel1.m3u8 HTTP/1.1
< HTTP/1.1 200 OK
< Date: Tue, 15 Sep 2015 13:37:56 GMT
< Server: Apache
< Last-Modified: Mon, 03 Aug 2015 3:14:15 GMT
< Accept-Ranges: bytes
< Content-Length: 219
< Cache-Control: max-age=5
- 44. HTTP Live Streaming
Add a no, or short age, cache header
Use segment name randomisation
Use Player metrics to detect problem ISPs / CDNs
- 46. CDN Selector
Build vs. buy
Excellent offerings on the
market
Metadata often tightly coupled
with platform, so tricky to use a
third party
- 48. CDN-aware Asset Info Service
AWS Elastic
Beanstalk
CDN
Authentication
Authorisation
Asset info
request
- 49. CDN-aware Asset Info Service
> GET /asset/31337 HTTP/1.1
< assetUrl: "http://cdn-a.alexjs.im/vod/31337.m3u8"
< adProvider: "alexjsAds"
< countryCode: "[im, sg, id]"
- 50. CDN-aware Asset Info Service
S3 Ingest
Ingest
Amazon
DynamoDB
Media processing
Amazon Elastic
Transcoder
Processing
- 51. CDN-aware Asset Info Service
S3 Ingest
Ingest
AWS Elastic
Beanstalk
Amazon
DynamoDB
Media processing
Amazon Elastic
Transcoder
Processing
Authentication
Authorisation
Asset info
request
- 52. CDN-aware Asset Info Service
S3 IngestAuthoritative Source – for multi-CDN
Ingest
AWS Elastic
Beanstalk
CDN
Amazon
DynamoDB
Media processing
Amazon Elastic
Transcoder
Processing
Authentication
Authorisation
Asset info
request
- 53. S3 IngestAuthoritative Source – for multi-CDN
Ingest
API
Gateway
CDN
Amazon
DynamoDB
Media processing
Amazon Elastic
Transcoder
Processing
Authentication
Authorisation
CDN-aware Asset Info Service
Perfect for microservices – and for serverless computing
Lambda
- 58. Subscriber Concurrency Management
{
assetId: "d6f9fe" // Programme ID
userId: "33114220875dc" // Token / User
ID timeStamp: "T00:00:05" // Progress
deviceId: "93d2d4fef95cb" // Fingerprint
deviceType: "Amazon Fire" // From API
}
(Pseudo JSON)
Amazon
Kinesis
Lambda
- 66. Go90 — from 30,000 ft
100+ micro services/systems
10+ deployments per week
Multiple clients, large target user base
High reliability/availability, low latency, superior
user experience
- 69. Governor
Accounts
Log Upload
Search
Profile Image
Discovery
Event Q
DRM
Metadata
Processing
Metadata
Ingest
Content
Ops
Analytics, Ad, Curate
3rd
Party
Analytic
s
Favorites
Cert
Prov
AWS
HSM
Ads
Offers and
Packages
DAI
backend
STB Maestro
Content
Ingest
CDN
Reco
Discovery
Accounts
Favorites
Search
DRM
Profile
Rights
SU
and…a 100 others
Profiles Profiles Q
- 72. Accounts
Log Upload
Search
Profile Image
Discovery
Event Q
DRM
Favorites
Cert
Prov
AWS
HSM
Ads
Offers and
Packages
DAI
backend
STB Maestro
Content
Ingest
CDN
Reco
Discovery
Accounts
Favorites
Search
DRM
Profile
Rights
SU
and…a 100 others
Profiles Profiles Q
Governor
Analytic
s
- 73. Governor
Accounts
Log Upload
Search
Profile Image
Discovery
Event Q
DRM
Metadata
Processing
Metadata
Ingest
Content
Ops
Analytics, Ad, Curate
3rd
Party
Analytics
Favorites
Cert
Prov
AWS
HSM
Ads
Offers and
Packages
DAI
backend
STB Maestro
Content
Ingest
CDN
Reco
Discovery
Accounts
Favorites
Search
DRM
Profile
Rights
SU
and…a 100 others
Profiles Profiles Q
- 85. Best Practices
Avoid a priori optimization
Deploy often
Keep simple and separate systems
Don’t always give in to “right tool for the right job”
- 87. Summary
• Avoid a priori optimization
• Deploy often
• Keep simple and separate
systems
• Don’t always give in to “right
tool for the right job”
Processing &
Management
Content
Production
Content
Distribution
Content
Storage
Content
Consumption
- 88. Summary
• Serverless by default
• Avoid lock-in
• Be cautious of the outside
• Reuse data for good
• Avoid a priori optimization
• Deploy often
• Keep simple and separate
systems
• Don’t always give in to “right
tool for the right job”
Processing &
Management
Content
Production
Content
Distribution
Content
Storage
Content
Consumption
- 89. Summary
• Serverless by default
• Avoid lock-in
• Be cautious of the outside
• Reuse data for good
• Avoid a priori optimization
• Deploy often
• Keep simple and separate
systems
• Don’t always give in to “right
tool for the right job”
Go Build.