本文介绍了MySQL 关系数据库设计的快速提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个网络应用程序,用于存储用户信息以及他们对应用程序的偏好.这值得拆分成两个数据库吗?我在想一个带有字段id,useridfromFacebook,facebookRealName"的表users"(所以 1, 52052025295,Alex McP),然后有一个带有字段id,useridfromFacebook,电子邮件,颜色,SomeQuoteorSomething"的表首选项"(4, 52052025295, 1, 441155, '只有优秀的英年早逝')

I have a webapp I'm making that stores user information, and their preferences regarding the app. Is this something worth splitting into two databases? I was thinking one table "users" with fields "id, useridfromFacebook, facebookRealName" (so 1, 52052025295, Alex McP), and then have a table "preferences" with fields "id, useridfromFacebook, emails, colors, SomeQuoteorSomething" (4, 52052025295, 1, 441155, 'Only The Good Die Young')

我从来没有被教授/学习过数据库设置,但这似乎会限制数据库的负载,因为当用户通过身份验证并安装了应用程序时,我只需要查询首选项表,如果(isset($fbauthboolean)) 之类的.

I've never been taught/learned myself about DB setup, but this seems like it would limit the load on the database because when a user is authenticated and has installed the app, I would only need to query the preferences table if(isset($fbauthboolean)) or something.

想法?我可以澄清一下吗?

Thoughts? Can I clarify this?

谢谢!

我在原始帖子中混淆了数据库"和表"这两个词.已编辑.我只有一个带有多个表的数据库,但都与同一个用户有关.一张表包含 NAME 数据,另一张表将存储 PREFERENCES 类型的数据

I confused the words "database" and "table" in my original posting. Edited. I'd have just ONE DB with multiple tables, but all relating to the same user. One table contains NAME data, and the other table would store PREFERENCES type data

推荐答案

我不认为您需要两个数据库,但您可能希望在同一架构中使用不同的表.

I wouldn't think you'd need two databases, but you might want separate tables in the same schema.

我真的很喜欢 Toby Teorey 的 数据库建模和设计".看看你是否同意.

I really liked Toby Teorey's "Database Modeling and Design". See if you agree.

我也喜欢数据库程序员博客.很有帮助,文笔不错.

I also like the Database Programmer blog. Very helpful, good writing.

如果您不想买书,您可能需要通过 Google 进行规范化.

If you don't want to buy a book, you might want to Google for normalization.

这篇关于MySQL 关系数据库设计的快速提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 22:00
查看更多