The scheme below displays the basic idea of streaming service based on AWS + WOWZA.
The process logic is divided into 3 parts:
- Work with streamers (origin )
- Work with viewers (edge)
- On call promos (ads) delivery (VOD)
RTMP stream comes to the load balancer AWS (wowza-origins), where it is decided which EC2 instance should it be redirected and attached to. On this instance there is a running service Wowza Streaming Engine, configured for content parsing. There is also the stream coding by means of the key SecureToken which is also declared on the edge side.
When a viewer wants to join a stream watch then he enters one of the instances for video retransmission through the load balancer AWS (wowza-edges). After that, using the module StreamResolver, the running service Wowza Streaming Engine knows which origin instance to connect to and begin the content retransmission.
Video-content is kept here to be displayed in the app.
Since all the traffic between origin/edge/vod moves across the intranet, delays are low. But the traffic from balancer goes directly to the user. This moment can be solved in two ways:
- AWS CDN
- Wowza CDN
Both variants have their advantages and disadvantages, however, they can complement each other in a way to increase the speed of content delivery.
It is necessary to point out auto-scaling. It is implemented with the help of:
- Creating own metrics based on managing instance.
- Launch configuration
- Ansible for configuring new instances.
The high speed of adding new instances (about 20-30 seconds) can be reached by means of:
- Configured AMIs
- Change of the part Wowza Streaming Engine configuration via REST API (Ansible)