SaaS多租户应用程序:如何实现数据导入/导出/备份?

发布于 2024-08-29 10:49:48 字数 319 浏览 10 评论 0原文

应用程序如何在基于 SaaS 的多租户应用程序(特别是单一数据库设计)中提供数据导入/导出(或备份)?

导入:

简单起见,我认为基本导入很有用,即 CSV 到规范(或者提供数据库中 CSV 列和字段之间映射的方法。

导出:

在单一数据库设计中,我看到过 XML 导出和 HTML(基本站点生成)导出数据?我认为 XML 是更好的选择吗?您如何引用 XML 中的各种内容并提供相关文档?关系或让用户弄清楚这一点?

供应商是否提供可以导入/恢复的导出/备份

How are applications providing import / export (or backups) of data in SaaS based multi-tenancy applications, particularly single database designs?

Imports:

Keeping things simple I think basic imports are useful, ie CSV to a spec (or a way of providing a mapping between CSV columns and fields in the database.

Exports:

In single database designs I have seen XML exports and HTML (basic sitse generated) exports of data? I would assume that XML is a better option? How does one cater for relational data? Would you reference various things within XML and provide documentation of the relationships or let users figurethis out?

Are vendors providing an export/backup that can be imported back in/restored?

Your comments appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何止钟意 2024-09-05 10:49:48

我不知道它是如何完成的,但这些是可能的情况:

  1. DB-per-customer
  2. schema-per-customer
  3. single-schema

案例 1 在备份/恢复(或导入/导出)方面很简单,案例 2 类似。我大胆猜测这两种是最常用的方法。

第三种选择使导出/导入变得困难,但并非不可能。基本思想是一个表保存所有公司的数据,但通过外键区分公司。导出和导入需要使用相同类型的 ETL 工具,因为这些操作需要按公司 ID。导出过程将公司作为参数并仅运行该公司的任务。转储将采用插入语句的形式(如使用 MySQL 或 PostgreSQL 获得的语句)或 XML(如由 DDLUtils)。

在某些情况下,单模式设置会派上用场,但我不认为多租​​户是其中之一。

I don't know how it's done, but these are the possible scenarios:

  1. DB-per-customer
  2. schema-per-customer
  3. single-schema

Case 1 is trivial in terms of backup/restore (or import/export), case 2 is similar. I would venture a guess that these 2 are the most used approaches.

The third option makes export/import difficult, but not impossible. The basic idea is that a table holds data from all companies, but distinguishes the company by a foreign key. Export and import would require the same kind of ETL tool to be used because these actions require filtering by company ID. The export procedure takes a company as a parameter and runs the task for that company only. The dump would take the form of insert statements (like the one you can get with MySQL or PostgreSQL) or XML (like the one created by DDLUtils).

There are situations where the single-schema setup comes in handy, but I don't think multi-tenancy is one of them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文