A very common and very important discussion we have with our clients before we build their custom WebRTC application is about architecture. Should it be a native WeRTC application, built on an open source media server, or use a commercial CPaaS platform?
Let’s talk about each one, their benefits and drawbacks, and what factors play into this important decision.
This content is also available in our WebRTC Tips by WebRTC.ventures YouTube series.
WebRTC is not quite this simple
When thinking more deeply about your WebRTC architecture, even for the most basic application for a 1:1 peer communication, there are many more things that you need to consider. These factors play an important role in choosing one of the three ways to build your application.
Native WebRTC Applications a.k.a. Building to the Standard
Here, you are using the WebRTC libraries and not much else! It is free, but it is also the most complex to do.
You must build and handle the following:
- Compile the WebRTC library
- STUN and TURN servers
- Application signaling
- Video codecs
- Scaling for thing like group chat
- Browser / Mobile support
- Add-on features such as recording or transcription
Building to the standard is actually a very powerful way to use WebRTC as having low-level library and code access can be beneficial. If you are doing something special, like adding Artificial Intelligence into your application, then building a native WebRTC application may be the right choice for you.
Still, it is usually the least likely choice due to all of the other complexity around it.
Open Source Media Servers
This is still generally a free solution, but it gives you some wrappers and additional functionality. The media server will handle many of the details for you, or at least abstract some of that complexity away from you. It will also help you with many best practices.
Open Source Media Servers will handle:
- Video/audio details
- Part or all of the WebRTC signaling process
- Possibly STUN/TURN
- Some scaling capabilities
- Could be SFUs or MCUs
- Browser/Mobile support
But you host/manage:
- All infrastructure
- Structural updates
- Media server updates
- It may be scalable, but you need to handle the scaling of the architecture infrastructure in the cloud
At WebRTC.ventures, we most commonly use Janus and Jitsi when we choose an Open Source media server.
With a commercial Communication Platform as a Service (CPaaS), you generally pay a monthly fee according to usage. Usage may include how much traffic you are generating, how many users are connected, how many minutes you are using, and whether you are broadcasting or just simply peer-to-peer.
In return, a CPaaS further abstracts WebRTC for you and takes away even more of the complexity of building and managing your application. This is a lot easier on your developers because it essentially takes care of establishing the video connection between the users.
A CPaaS will handle:
- All WebRTC supports / updates
- Media Servers
- Browser/Mobile support
- Additional features around the video like recording, broadcasting, or transcription
- Additional APIs that you can tap into if you need SMS texting, two factor identification, or Voice/VOIP telephony integration. This is great for when you need an omni channel application which uses multiple communication methods.
The more persuasive reason many go with a CPaaS is to get to market faster with less up front costs. This is very important for startups trying to prove the validity of their product.
Ongoing costs, however, will be higher than the other alternatives. For this reason, we have many clients who started with a CPaaS and then moved to an open source solution for the long haul.
At WebRTC.ventures, the CPaaS’s we use most commonly are Vonage, Agora, and Twilio. There are other platforms to that specialize in particular verticals. We’re happy to help you think through those options.
Ultimately, it is all about trade-offs
Here are some simple rules you can follow:
- If your up-front cost and time to market are the most important, go with a CPaaS solution.
- If your ongoing costs are most important, go with Open Source.
- If you need access to low level details, go native.
We’d be happy to talk through your project to find the right solution and work with you to build your custom WebTC application. Leverage our experience and contact WebRTC.ventures today!