The Architecture
This article will be followed by more discussing my experience regarding designing a full featured online radio station.
This article targets mainly people with experience with the Linux operating system, let's start.
here is the full architecture of the solution, while it may seem complicated, it is not.
Normally, an online Radio Station should provide two services:
- Continuous audio playing of track files.
- Live broadcasting.
- Media Storage: that is basically the audio tracks that you want to stream saved in MP3 format (may other formats like OGG), locally attached SSD drives were used here.
- Media Streamer: that is the application that would access the audio file and read it (because it understands how to read it) and send the data to the streaming server, ICES was used for this role.
- Streaming Server: an application to multiply the data sent by the media streamer to the connected clients, thus, multiple users can here the same track, nearly in the same time, ICECAST2 used here.
- Resful Web service (Java Application): actually, this is the heart of the radio station, it exposes various web services to be consumed and used by the media streamer to select the next track or to display the currently one being played on the web interface, also, it is used to collect radio statistics collected from the ICECAST2 server.
- Database Engine: MySQL is used to store tracks and users metadata.
- Application Server: Tomcat is used to host a simple Java webapp that act as the web user interface for the radio.
- Media Discoverer: another simple Java Application that would detect new tracks and file them based upon their names and update the MySQL track metadata database, that app is triggered periodically every 15 min.
- Web Server: Apache was used as the only interface to the compartment, serving both the web traffic and the radio traffic from port 80 and serving administration tools from port 443.
- Administration Tools: various HTTP based tools like webmin, zabbix and iRedMail panels, all the tools run over HTTPS and protected by basic user authentication.
- Firewall: UFW console interface to IPTABLES was used to restrict access to ports 80, 443 and 22 only.