views:

165

answers:

1

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.

+1  A: 

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.

Tomislav Nakic-Alfirevic