Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 对于复杂的情况,要选择哪种数据库类型(关系型/NoSQL和哪种类型)_Mysql_Relational Database_Scalable_Nosql - Fatal编程技术网

Mysql 对于复杂的情况,要选择哪种数据库类型(关系型/NoSQL和哪种类型)

Mysql 对于复杂的情况,要选择哪种数据库类型(关系型/NoSQL和哪种类型),mysql,relational-database,scalable,nosql,Mysql,Relational Database,Scalable,Nosql,对于我们的一项SaaS服务,我们正在研究使用哪种数据库,因为我们正在从头开始设计它 我们当前的解决方案使用MySQL,并为每个新客户创建单独的数据库。目前的(全球)结构是: - globaldb.globaltable => some global data shared with all customers => big => it would be an option to flatten this data in the customerdb.ta

对于我们的一项SaaS服务,我们正在研究使用哪种数据库,因为我们正在从头开始设计它

我们当前的解决方案使用MySQL,并为每个新客户创建单独的数据库。目前的(全球)结构是:

- globaldb.globaltable
    => some global data shared with all customers
    => big
    => it would be an option to flatten this data in the customerdb.tablewithreportlines, but this increases the size quite a bit

- customerdb.tablewithstaticdata
    => joins with `globaltable`
    => searched on several columns
    => no group by
    => writes throughout the day, in the thousands
    => reads on request by the customer via the application, so not continuesly
    => can be big per customer, serveral GBs

- customerdb.tablewithreports
    => searched on several columns
    => writes throughout the day, but only in the tens
    => reads on request by the customer via the application, so not continuesly
    => quite small

- customerdb.tablewithreportlines
    => joins with `tablewithreports`
    => joins with `globaltable`
    => most columns are 'searchable'
    => most columns are 'groupable'
    => writes throughout the day, in the thousands but only when processing the `tablewithreports` lines
    => reads on request by the customer via the application, so not continuesly
    => can be big per customer, serveral GBs
customerdb
数据从不更新,只是插入(偶尔删除)

我们正在为快速增长做准备,需要一个为之做好准备的结构。可以手动添加新实例(如果需要)

我们之前为一个测试项目设置了一个MySQL,其中包含大量的表(和数据库)。该项目失败,因为服务器超过了MySQL表的最大文件处理程序数。这大约是+-500.000张桌子。这个新项目肯定需要能够处理500000个客户,因此需要150万个表(按照当前的结构)

每个客户数据库的平均大小为+-7,5Mb。没有太多,但由于服务器客户的数据库中有多个GBs,所以它非常普及

我已经搜索了SO和Google来寻找匹配的情况,但是没有找到

在这一点上,我们愿意接受任何建议,无论是关系型、NoSQL还是组合型,因为我们正在进行全面的重新设计

问题什么是最适合此用例的数据库


P:这是我的第一篇文章,所以请原谅我不完整。

< P>我建议你为所有的客户考虑使用一个公共数据库。这从根本上减少了表的数量

数据库管理系统不是为这么多的数据库或表设计的

通常,表是一个实体,表示同一类对象的集合。因此,相同类型的所有对象(如您案例中的客户)都应该放在一个表中,而不是为每个客户单独设置一个表