是这种SQL结构化(在mysql数据库)高效的真实世界模型? [英] is this sort of SQL structuring (in a mysql database) efficient in a real world model?

查看:150
本文介绍了是这种SQL结构化(在mysql数据库)高效的真实世界模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在真实世界环境中获得有关在现实世界中使用复杂mysql的人的示例mysql结构的反馈。

i was hoping to get feedback on an example mysql structure for a web application in a real world environment from people who have used complex mysql in real world situations before.

example〜

教育管理应用程式。
80,000个用户。
每个用户获取他自己的数据库包含
的表
$ b -uploads
-grades
-info

education management app. 80,000 users. each user gets his own database containing tables for -messages -uploads -grades -info

和其他功能的更多表格

我想知道的是,任何信息将被赞赏,在这样的情况下

what I'm wondering is, and any info would be appreciated, in a situation like this

- 这个数据库模型有效吗? (基本上就像80,000个数据库)还是有(我有这种感觉有)是更好的方法吗?
- 什么是专用服务器这将需要? 80,000个数据库,每个10-15个表包含TONS表,所有8万人每天访问该站点20-30次,共10-20次会话

-is this databasing model efficient? (basically like 80,000 databases) or is there (and I have this itching feeling there is) a better way to do it? -what kind of dedicated server would this require? 80,000 databases each with 10-15 tables containing TONS of tables, with all 80,000 people accessing the site 20-30 times a day for 10-20 sessions

推荐答案

开始运行。

现在!

不说笑话,不要这样做。不要为每个用户创建一个数据库。这是一个管理,维护和查询的地狱。如果你需要知道哪些用户昨天登录怎么办?你会查询每个数据库吗

Jokes aside, don't do that. Don't create one database per user. That's a hell to administer, maintain and to query. What if you need to know which users logged in yesterday? Will you query each database??

你需要的结构是一样的,只是数据量的变化。只要有一个数据库,看看它是怎么回事,然后优化/微调。

The structure you need is the same, only the amount of data changes. Just have one database, see how it goes and then optimize/fine tune.

我讨厌把这个报价上来,但在你的情况下它完全适用:

I hate to bring this quote up, but in your case it totally applies:


过早优化是所有邪恶的根源(Donald Knuth)

Premature optimization is the root of all evil (Donald Knuth)

不要尝试在之前<知道你的瓶颈在哪里。

Don't try to optimize your solution before you know where your bottlenecks will be.

只要建模你的数据库,你可以。担心你的约束,PK,FK,索引。您的数据库设计作业。然后让你的数据和软件去。只有这样,你会看到它的工作原理和伤害的地方。

Just model your database the best you can. Worry about your constraints, PKs, FKs, Indexes. Do your database-design homework. Then have your data and software going. Only then you will see where it works and where it hurts. At this moment, you optimize.

只有当你知道他是谁时才会攻击你的敌人。

Only attack your enemy when you know who it is.

这篇关于是这种SQL结构化(在mysql数据库)高效的真实世界模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆