Skip to content

How to set up a redundant DVR service

When building an IPTV service, you need to ensure that:

  • The DVR archive is preserved.
  • The service is always available.

To achieve these goals, set up a redundant DVR service. To do that, use the Flussonic cross-replication mechanism.

On the page:

What's cross-replication and why do you need it

Cross-replication is an archive redundancy mechanism where two Flussonic servers record and store the stream archive. These servers can access the source and restore missing segments of the archives from each other (for details see How cross-replication works). The archives on the servers are full copies of each other.
If one of the servers becomes unavailable, the second one continues to record the archive, accessing the source directly. When the first server comes back online, it automatically retrieves the missing segments from another server.

Cross-replication is replication from the first server to the second one and vice versa.

With cross-replication, your service:

  • Continues providing the archive recordings to viewers if one of the servers with the archive crashes or becomes temporary unavailable.
  • Restores missing segments of the archive when the server returns online by transferring data from the working server.
  • Ensures that the archives on the servers are identical.

How cross-replication works

Note

When transmitting streams between Flussonic servers, it's recommended to use Flussonic's proprietary protocol—M4F. Read more about the benefits of the M4F streaming protocol in the M4F protocol overview section.

Cross-replication mechanism in Flussonic applies to a stream archive, rather than a server archive. If you need to configure cross-replication to several streams, you should configure it for each stream.

Cross-replication works in three modes:

  • Normal mode:

Normal mode

  • The primary server captures the live stream from the UDP source and writes it to the archive of some example_stream.
  • The secondary server captures the live stream and the archive of the primary example_stream stream from the primary server via M4F to the backup stream replica_example_stream.

  • Emergency mode:

Crash mode

  • The primary server goes offline, stops receiving the live stream from the UDP source and writing it to the archive.
  • The backup replica_example_stream stream switches directly to the UDP source. The secondary server receives the live stream from the UDP source and keeps writing the archive of the stream.

  • Disaster recovery mode:

Disaster recovery mode

  • The primary server comes back online and the primary stream example_stream switches back to the UDP source. The server captures the live stream from the UDP source and writes it to the archive.
  • The primary server retrieves the missing segments of the archive from the secondary server while the primary server was offline.
  • The backup stream switches back to the primary server. The secondary server captures the live stream from the primary server and keeps writing the stream to the archive.

How to configure cross-replication

To set up cross-replication of a stream example_stream on two Flussonic servers, configure the following on both servers:

  • ingest from the source (input udp://)
  • ingest from the Flussonic server for replication (input m4f://)
  • DVR on both servers (dvr /storage 3d) with the replicate option

Suppose primary_flussonic.example.com is the primary server, and secondary_flussonic.example.com is the secondary server.

Primary stream configuration on the primary primary_flussonic.example.com server:

stream example_stream {
  input udp://224.1.2.3:1234;
  input m4f://secondary_flussonic.example.com/replica_example_stream;
  dvr /storage 3d replicate;
}

Backup stream configuration on the secondary secondary_flussonic.example.com server:

stream replica_example_stream {
  input m4f://primary_flussonic.example.com/example_stream;
  input udp://224.1.2.3:1234;
  dvr /storage 3d replicate;
}