大型数据库表的设计技巧?
这里是数据库新手。
我想规划一个销售发票数据库,其中每月将添加数百万条记录/行。
里面的数据不是那么重,只是一些信息,例如id,amount等...
问题是表需要非常(非常)频繁地更新。
我担心表会增长得如此之快,从而在未来减慢系统速度。
我正在寻找一般设计技巧,我应该如何更新这种表格。
我的架构中还有一些其他表,但该表是最重要且更新最频繁的表。
是否有任何设计/技巧/架构,这样我就不必直接更新该表。
这是我的简要平台。
Application : java/spring mvc
Database : mysql
OS : CentOS 6
A Database newbie here.
I would like to plan a sales invoice database in which millions of records/rows will be added a month.
The data inside is not that heavy but a few information like id,amount, etc...
The problem is that table needs to be updated very (very) frequently.
I am concerned that table will grow so quickly and slow down the system in the future.
I am looking for a general design tips how should I update that kind of table.
I have some other tables in my schema but that table is the most important one and the most frequently updated.
Is there any design/tip/architecture so I do not have to update that table directly.
Here is my platform in brief.
Application : java/spring mvc
Database : mysql
OS : CentOS 6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
规则一:在速度变慢之前不要担心性能。
规则 2:将这些表规范化到至少 3NF
规则 3:如果有大量更新,请简化索引,不要声明唯一索引。
规则4:表的大小不影响插入速度。 (除非您有唯一索引)
提示:使用 InnoDB。
Rule 1: don't worry about performance before slowness hits you.
Rule 2: normalize those tables up to at least 3NF
Rule 3: If you have lots of updates, go easy on the indexes and do not declare unique indexes.
Rule 4: The size of a table does not affect the insert speed. (Unless you have unique indexes)
Tip: Use InnoDB.