Meet Company X
Company X, a leading SaaS provider, made the strategic decision to incorporate MongoDB Atlas into their multi-tenant architecture. Prioritizing simplicity, scalability, and cost efficiency, they established a single Atlas shared cluster, bolstered by numerous replicas to enhance read performance. To further optimize their system, the cluster was configured to automatically scale based on CPU and memory usage.
Three Key Challenges
1. Connection Pooling and Security Risks
Company X initially saw the single-cluster approach as a perfect solution. However, they soon encountered a roadblock: maintaining separate connections for each tenant was untenable beyond a few hundred tenants. This led them to use a shared connection pool, inadvertently risking cross-tenant data access.
2. Lack of Tenant-Specific Observability
Complicating matters further, the built-in MongoDB stats lacked tenant-specific insights. This absence of granular metrics lengthened the troubleshooting process and necessitated increased team involvement.
3. The Scaling Dilemma
Auto-scaling, while a feature of MongoDB Atlas, had its own set of issues. Delays in scaling operations posed a significant risk during unexpected load spikes, making quick identification of the load source a critical, yet often elusive, task.
The DIY Approach: A Costly Detour
Recognizing the need for immediate action, the engineering team took the reins. They customized their Application Performance Monitoring (APM) system for high-cardinality metrics, albeit at a steep cost. Additionally, they modified code to isolate tenant data and implemented circuit breakers and rate limiters. Despite being steps in the right direction, this DIY approach drained valuable development resources and added considerable ongoing maintenance challenges associated with keeping the DIY solution in line with development of company X SaaS.
A Shift in Approach: Finding a Better Way
Eventually, Company X discovered a specialized service for tenant-centric observability and control - SuperTenant. Utilizing SuperTenant’s turnkey solution, they resolved their challenges in a fraction of the time and cost associated with their initial efforts. Employing SuperTenant they obtained real-time, tenant-level metrics and in-line congestion remediation tools, simplifying the management of their multi-tenant SaaS environment.
Conclusion
The above journey, which may resonate with those who have faced similar challenges, serves as a valuable lesson in navigating the complexities of multi-tenant architectures. By choosing specialized solutions designed to address these unique challenges, companies can save time, cut costs, and heighten operational efficiency.
Further Reading
For those interested in delving deeper into the nuances of multi-tenant SaaS architectures, we invite you to schedule a demo with our team.