如何轻松地设计DB表/模式? [英] How to design DB table / schema with ease?

查看:124
本文介绍了如何轻松地设计DB表/模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个简单的方法来决定你设计的应用程序中每个表需要哪些字段和索引?

Is there a simple method to decide on what fields and indexes are needed for each table in an app you design?

例如,如果它是一个webapp只需允许人们创建列表(任意数量的列表,用户可以创建待办事项列表或购物列表),用户可以分配其他用户来编辑列表,以及列表是公开还是只能查看某些用户,如何可以设计表格,使其非常准确和快速设计?关于索引呢?

For example, if it is a webapp that simply lets people create lists (any number of lists, and users can create "things to do" list or "shopping" list), and the user can assign other users to edit the list, and whether the list is viewable publicly or to only certain users, how can the tables be design so that it is very accurate and designed quickly? What about the indexes?

我在大学做过,然后在一段时间之前重新回答了问题,并且有一个方法,但是想知道是否有标准和好的

I did that in college and then revisited the question some time ago and have a method, but would like to find out if there are standard and good ways to do it out in the field.

推荐答案

数据库设计很难...

Database design is hard ...

与生活中的许多事情一样,这是一系列的折衷。你需要决定的第一件事是你将使用的DBMS(MySQL,SQL Server,Oracle,PostgreSQL,面向对象的数据库之一等)。

As with many things in life, it's a series of tradeoffs. The first thing you need to decide is what DBMS you will use, (MySQL, SQL Server, Oracle, PostgreSQL, one of the "Object-oriented" databases, etc.

然后你需要决定标准化v。疯狂的JOIN号码来获得你的数据。需要解决像在触发器,存储过程,应用代码中实现多少逻辑等等的问题。

Then you need to decide on normalization v. insane numbers of JOINs to get to your data. Questions like "how much logic will I implement in triggers, stored procedures, in app code, etc" need to be addressed.

没有Quick'n'Easy方式设计除了最微不足道的数据库之外的任何东西。

'课程,这只是我的经验。YMWV。

'Course, that's just my experience. YMWV.

这篇关于如何轻松地设计DB表/模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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