We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
cover of episode #114: Best practices for building a multi-tenant system with Khawaja Shams

#114: Best practices for building a multi-tenant system with Khawaja Shams

2025/3/12
logo of podcast Real World Serverless with theburningmonk

Real World Serverless with theburningmonk

AI Deep Dive AI Chapters Transcript
People
K
Khawaja Shams
Topics
Khawaja Shams: 我在职业生涯早期从事硬件工作,后来转向软件开发,并不断寻求更高效的解决方案,例如在2008年至2009年期间,我将整个图像处理流程迁移到AWS,利用S3和SQS等无服务器服务来应对图像处理峰值。在亚马逊期间,我领导了DynamoDB团队,并在AWS Elemental负责媒体服务的工程和产品工作。现在,作为Momento的联合创始人,我们致力于帮助客户轻松构建高性能、关键任务、大规模应用,尤其在缓存和消息方面,我们简化了在前端应用中添加消息传递的过程,解决了WebSockets带来的挑战。 我们采用蜂窝架构,将区域划分为更小的单元,从而降低单点故障的影响,并使各个单元更相似,更容易进行测试和管理。蜂窝架构的核心价值在于减少故障的影响范围,并为架构设计提供更明确的限制。它允许将大型客户部署到独立单元中,从而获得更大的灵活性。Momento的蜂窝架构与AWS的不同之处在于,Momento为大型客户提供专用单元,而AWS则在单元内容纳多个客户。我们利用多租户技术提高资源利用率,并根据客户需求进行定制化调整。 蜂窝架构会减慢部署速度,需要谨慎设计部署策略。AWS的最佳实践是将每个单元部署到独立的账户中,但这种方法在单元数量较多时会带来管理上的挑战。我们也面临着账户限制的问题,需要不断申请资源配额的提升。服务等级协议(SLA)应该基于客户的体验,而不是整体系统的表现来衡量,应该基于每个客户的体验来衡量SLA并提供相应的补偿。 多租户架构能够更好地处理大规模流量突增,大型多租户系统能够更好地应对流量突增,因为它们已经过多次测试和优化。即使没有明显的客户影响,也应该深入分析性能问题,持续改进服务。Momento的单元是自包含的,目前没有单元间的通信。我们对单元大小设置了工程限制,并努力提高每个节点的性能,从而实现更大的水平扩展。如果客户的请求量超过单个单元的处理能力,则需要将其拆分到多个单元中。单元信息包含在请求令牌中,用于确定请求路由到哪个单元。 尽早投资蜂窝架构,特别是基础设施即代码和可观察性方面。根据单元特性选择合适的实例类型,例如C7GN实例。将服务从Java重写为Rust,提高了性能,并使一些高级优化技术成为可能,例如AWS Placement Groups、核心绑定和流量路由等技术可以显著提高性能。将应用从Java迁移到Rust并不一定能立即带来显著的性能提升,仍然需要进行性能调优。Momento正在与S3集成,并探索在AI领域的新应用场景。 Jan: (无核心论点,主要为提问和引导讨论)

Deep Dive

Chapters
This chapter starts by introducing Momento and its co-founder Khawaja Shams. It then delves into a recent incident where a customer unexpectedly sent a million requests per second, highlighting Momento's ability to handle such spikes with minimal impact. The discussion also touches upon the importance of developer experience and the ease of use of Momento's services, particularly in real-time communication systems.
  • Momento handles millions of transactions per second (TPS) with minimal impact.
  • Cellular architecture is key to Momento's scalability and resilience.
  • Developer experience is a core value proposition for Momento.

Shownotes Transcript

In this episode, I spoke with Khawaja Shams, co-founder of Momento, about cell-based architectures and how it allows Momento to scale to millions of transactions per second (TPS) while maintaining a healthy blast radius within their multi-tenant system.Links from the episode:

  • Momento)
  • Khawaja on X)
  • Khawaja on LinkedIn)
  • Believe In Serverless community)

Opening theme song:Cheery Monday by Kevin MacLeodLink: https://incompetech.filmmusic.io/song/3495-cheery-mondayLicense: http://creativecommons.org/licenses/by/4.)