关于 Rails 中多租户与多数据库应用程序的任何想法 [英] Any thoughts on Multi-tenant versus Multi-database apps in Rails

查看:35
本文介绍了关于 Rails 中多租户与多数据库应用程序的任何想法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用目前为每个客户端生成一个新数据库.我们开始怀疑是否应该考虑将其重构为多租户系统.

Our app currently spawns a new database for each client. We're starting to wonder whether we should consider refactoring this to a multi-tenant system.

我们应该考虑哪些好处/权衡?在 Rails 中实现多租户应用的最佳做法是什么?

What benefits / trade-offs should we be considering? What are the best practices for implementing a multi-tenant app in Rails?

推荐答案

我一直在研究同样的事情,刚刚发现这个演示文稿提供了一个有趣的解决方案:使用 Postgre 的模式(有点像命名空间)在DB 级别,同时将所有租户保留在同一个 DB 中,并且(大部分)对 Rails 保持透明.

I've been researching the same thing and just found this presentation to offer an interesting solution: Using Postgre's schemas (a bit like namespaces) to separate data at the DB level while keeping all tenants in the same DB and staying (mostly) transparent to rails.

在 Rails 中编写多租户应用程序 - Guy Naor

这篇关于关于 Rails 中多租户与多数据库应用程序的任何想法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆