1

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

进口:

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

出口:

在单一数据库设计中,我见过 XML 导出和 HTML(基本生成的)数据导出吗?我会假设 XML 是一个更好的选择?如何满足关系数据的需求?您会在 XML 中引用各种内容并提供关系文档还是让用户弄清楚这一点?

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

您的意见表示赞赏。

4

1 回答 1

1

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.

于 2010-04-18T11:37:19.210 回答