成熟度模型
Supabase 很适合快速构建东西,同时也适合扩展。不过,需要注意的是,随着你的应用逐渐成熟和团队壮大,你在生产环境中管理应用的做法不应该和最初做原型时的做法一样。
🌐 Supabase is great for building something very fast and for scaling up. However, it's important to note that as your application matures and your team expands, the practices you use for managing an application in production should not be the same as the practices you used for prototyping.
原型制作 #
🌐 Prototyping
仪表板是一个快速简单的工具,可以在你进行原型设计时构建应用。话虽如此,我们强烈建议使用 迁移 来管理你的数据库更改。你可以使用我们的 CLI 来 捕捉你在仪表板上所做的任何更改,以便你可以将它们提交到像 git 这样的版本控制系统中。
🌐 The Dashboard is a quick and easy tool for building applications while you are prototyping. That said, we strongly recommend using Migrations to manage your database changes. You can use our CLI to capture any changes you have made on the Dashboard so that you can commit them a version control system, like git.
合作中 #
🌐 Collaborating
一旦你开始与团队成员合作,所有项目的变更都应该在版本控制中。在这个阶段,我们强烈建议不要再使用仪表板来进行模式更改。使用迁移来管理你的数据库,并将它们提交到版本控制系统,以跟踪每一次更改。
🌐 As soon as you start collaborating with team members, all project changes should be in version control. At this point we strongly recommend moving away from using the Dashboard for schema changes. Use migrations to manage your database, and check them into your version control system to track every change.
资源:
🌐 Resources:
在生产中 #
🌐 In production
一旦你的应用上线,你就绝不应该通过仪表板更改数据库——所有操作都应该通过 Migrations 完成。在这一点上还需要考虑一些其他重要的事项,包括:
🌐 Once your application is live, you should never change your database using the Dashboard - everything should be done with Migrations. Some other important things to consider at this point include:
- 仪表板有各种访问级别,可以防止通过用户界面进行更改。
- 为管理你的数据库设计一个安全的工作流程。我们强烈建议在开发工作流程中运行多个环境(
local->staging->prod)。 - 不要与团队分享任何生产环境的密码,_尤其是_你的
postgres密码。所有更改都应该通过受版本控制的迁移来进行,并通过堡垒主机或 CI 平台(比如 GitHub Actions)运行。如果你使用 GitHub Actions,使用 审批工作流 来防止迁移意外执行。 - 使用网络限制来限制对你的数据库的生产访问。
- 随着你的数据库增长,我们强烈建议迁移到时间点恢复。这样更安全,并且在维护窗口期间对数据库性能的影响更小。
- 阅读 生产清单,并让你的团队熟悉你们组织与 Supabase 之间的 共享责任。
资源:
🌐 Resources:
企业 #
🌐 Enterprise
为了更安全的设置,可以考虑将工作负载分布在多个组织中。通常的做法是设立一个生产组织,只允许那些有资格直接访问生产数据库的团队成员进入。
🌐 For a more secure setup, consider running your workload across several organizations. It's a common pattern to have a Production organization which is restricted to only those team members who are qualified to have direct access to production databases.
如果你需要为你的组织设计安全的开发工作流程,可以联系growth寻求帮助。
🌐 Reach out to growth if you need help designing a secure development workflow for your organization.