To help you build a multitenant environment for your SaaS application using LiveKit, here are some friendly best practices to consider:
•
Distributed Mesh Architecture: Leveraging LiveKit's distributed mesh architecture can really boost scalability and smoothly handle lots of participants at once.
•
Multi-Home Architecture: Setting up multiple points of presence (PoPs) around the world helps keep latency low, so your users get a great experience no matter where they are.
•
Tenant Isolation: It’s important to keep tenants well isolated by using separate networks and adding rate limits and access controls to keep things secure and running smoothly.
•
Agent Worker Deployment: Since workers are stateless and easy to scale horizontally, using separate LiveKit projects and credentials for development and production can really help keep things organized.
•
Redis for Clustering: Configuring Redis for distributed operation allows for smart routing and better performance, which can make a big difference.
•
Failover and Draining: Adding connection draining and failover mechanisms ensures your system stays reliable and available, even when things get busy.
For your case with 150 customers using voicebots, you have a few options to consider:
• Assigning one agent per customer for strong isolation.
• Using one agent per voicebot per customer if you want more granular control.
• Or going with a single agent that uses dynamic configuration for simplicity and scalability.
Which approach fits best really depends on what matters most to you—whether that’s isolation, scalability, or ease of management. Feel free to reach out if you'd like me to walk you through any of these options in more detail—I’m here to help!
Sources:
examples/voice_agents/llamaindex-rag/data/raw_data.txt |
How We Built a Globally Distributed WebRTC Mesh Network |
How We Built a Globally Distributed WebRTC Mesh Network |
SECURITY.md |
delay-handling/raw_data.txt