简体   繁体   English

用于在云上构建企业Web(RIA)应用程序的数据库体系结构(单个数据库与客户端特定数据库)

[英]Databse architecture (single db vs client specific db) for Building Enterprise Web (RIA) application on cloud

We are working on rewriting our existing RIA and redesigning our database to re-architect it's design. 我们正在努力重写现有的RIA并重新设计我们的数据库以重新设计它的设计。 Now we have 2 opinions about database: 现在我们对数据库有2条意见:

(This choices are for SaaS based hosting.) (此选择适用于基于SaaS的托管。)

1) Individual database for each customer. 1)每个客户的个人数据库。

2) Single DB for all customers. 2)所有客户的单个DB。

We are expecting good amount of data, some of our customers have db size ranging from 2GB to 10GB. 我们期待大量的数据,我们的一些客户的数据库大小从2GB到10GB不等。 # of tables are around 100. 表的数量大约是100。

Can I get an answer about which choice we shall go for? 我可以得到一个答案,我们将选择哪种选择?

We are not thinking about NoSQL solution as of now but we are planning to support about 4-5 databases with JPA (Java Persistence API) which includes MySQL, Postgres, Oracle, MSSQL for now. 我们目前没有考虑NoSQL解决方案,但我们计划支持大约4-5个数据库,其中包括JPA(Java持久性API),其中包括MySQL,Postgres,Oracle,MSSQL。

PS: We might leverage Amazon cloud for hosting. PS:我们可能利用亚马逊云进行托管。

The three main techniques that is usually applied to the database usage for this kind of a multi-tenant requirement is below. 下面通常应用于此类多租户要求的数据库使用的三种主要技术。 You have already specified some of them. 您已经指定了其中一些。

  1. Separate databases for each tenant: 每个租户的单独数据库:
    • very high cost, easy to maintain/customize, easy to tune, easy to backup, easy to code to. 成本非常高,易于维护/定制,易于调整,易于备份,易于编码。
  2. Shared database but different schema: 共享数据库但不同的架构:
    • Low cost compared to (1), may encounter issues quickly with increased db size, easy to personalize per tenant, difficult to backup/restore per tenant, easy to code to. 与(1)相比成本低,可能会随着db大小的增加而迅速遇到问题,每个租户容易个性化,每个租户难以备份/恢复,易于编码。
  3. Shared database Shared schema: 共享数据库共享模式:
    • Low cost, load of one tenant will affect others, security and app development a challenge, difficult to personalize per tenant, difficult to restore/backup. 低成本,一个租户的负载将影响其他人,安全性和应用程序开发是一个挑战,每个租户难以个性化,难以恢复/备份。

I think the above points hold good for hosting on premise or on cloud. 我认为以上几点对于托管内部或云端有用。 If you see the number of tenants growing or the data getting bigger then 1) or 2) is better. 如果您看到租户数量增加或数据变大,则1)或2)更好。 I have used option 2) and have seen it helping development and maintenance. 我使用了选项2)并且已经看到它有助于开发和维护。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM