如何为大型数据库使用命名约定? [英] How to use a naming convention for large databases?

查看:95
本文介绍了如何为大型数据库使用命名约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正忙于使用MySql数据库开发2个基于Web的系统,并且表/视图/存储例程的数量确实变得越来越多,处理复杂性也变得越来越具有挑战性。

I am busy developing 2 web based systems with MySql databases and the amount of tables/views/stored routines is really becoming a lot and it is more and more challenging to handle the complexity.

现在在编程语言中,我们有命名空间。 Java包,C ++命名空间来分区软件,将它们组合在一起以使事情更容易理解。另一方面,数据库具有更多的平面结构(至少MySql),例如表和存储过程在同一级别。所以一个人必须更有创意,创造命名约定,可能使用多个数据库或使用工具来可视化的东西。

Now in programming languages we have namespacing e.g. Java packages, C++ namespaces to partition the software, grouping it together to make things more understandable. Databases on the other hand have more of a flat structure (MySql at least) e.g. tables and stored procedures are on the same level. So one have to be more creative, creating naming conventions, perhaps use more than one database or using tools to visualize things.

你使用什么方法来缓解疼痛?要在开发数据库时有效?

What methods do you use to ease the pain? To be effective while developing your databases? To not get lost in a sea of tables and fields and stored procs?

请随意提及您使用的工具,但尝试将其限制为开放源代码,最好是Linux解决方案如果可以的话。

Feel free to mention tools you use also, but try to restrict it to open source and preferably Linux solutions if thats OK.

btw在设计方面,数据库需要考虑多少个表?

b.t.w How many tables would a database have to be considered large in terms of design?

推荐答案

我发现的唯一解决方案是普遍适用的是开发一系列前缀并将它们应用到表(例如,主要与人力资源相关的表都将从hr_开始) 。我通常在应用程序(表单,报告,视图,存储过程)中将前缀转移到其他对象。

The only solution I've found that is generally applicable is to develop a series of prefixes and apply them to tables (for instance, tables relating primarily to Human Resources would all start hr_). I generally carry the prefixes across to other "objects" in the application (forms, reports, views, stored procedures).

这个解决方案远非完美,一个黑客,但它给系统带来了一点点秩序。

This solution is far from perfect and is something of a hack but it does bring a modicum of order to the system.

这篇关于如何为大型数据库使用命名约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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