数据库设计可处理大量数据 [英] Database design for very large amount of data

查看:85
本文介绍了数据库设计可处理大量数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一个涉及来自美味网站的大量数据的项目.可用的数据是日期,用户ID,网址,标签"(针对每个书签).

I am working on a project involving large amount of data from the delicious website. The data available is "Date, UserId, Url, Tags" (for each bookmark).

我将数据库归一化为3NF,并且由于我们想结合使用查询的性质,我将其归结为6个表...但是,现在的设计看起来不错,因为有大量数据在数据库中,大多数查询需要将至少2个表连接在一起才能得到答案,有时是3或4.起初,我们没有任何性能问题,因为对于测试而言,我们没有添加太多数据到数据库.现在我们拥有大量数据,简单地连接非常大的表将花费大量时间,并且对于我们的项目而言,这必须是实时的,这是一场灾难.

I normalized my database to a 3NF, and because of the nature of the queries that we wanted to use in combination, I came down to 6 tables... The design looks fine, however, now that a large amount of data is in the database, most of the queries need to join at least 2 tables together to get the answer, sometimes 3 or 4. At first, we didn't have any performance issues, because for testing matters we had not added too much data to the database. Now that we have a lot of data, simply joining extremely large tables takes a lot of time and for our project, which has to be real-time, this is a disaster.

我想知道大公司如何解决这些问题.看起来规范化表只会增加复杂性,但是大公司如何处理数据库中的大量数据,他们不使用规范化吗?

I was wondering how big companies solve these issues. Looks like normalizing tables just adds complexity, but how does the big company handle large amounts of data in their databases, don't they use normalization?

谢谢.

推荐答案

由于您询问了大公司(通常)是如何做到这一点的:

Since you asked about how big companies (generally) approaches this:

他们通常有一个dba(数据库管理员)来生活和维护公司使用的数据库.

They usually have a dba(database administrator) who lives and breathes the database the company uses.

这意味着他们拥有的人都知道一切,从如何最佳地设计表,分析和调整查询/索引/OS/服务器,到知道RAID控制器的固件版本会导致数据库问题.

This means they have people that know everything from how to design the tables optimally, profile and tune the queries/indexes/OS/server to knowing what firmware revision of the RAID controller that can cause problems for the database.

例如,您谈论的不是什么调优

You don't talk much about what kind of tuning you've done, e.g.

  • 您是否正在使用MyISAM或InnoDB表?对于不同的工作负载,它们的性能(至少是它们的功能)完全不同.
  • 表是否根据您运行的查询正确索引了?
  • 对所有查询运行EXPLAIN-这将帮助您识别可以添加/删除的键,选择正确的键,比较查询(SQL为您提供了完成相同任务的许多方法)
  • 您是否调整了查询​​缓存?对于某些工作负载,查询缓存(默认启用)会导致相当大的速度降低.
  • 您的设备盒有多少内存,并且mysql已调整为利用此内存?
  • 您是否使用文件系统和针对数据库的RAID设置?
  • 有时需要一些非规范化.
  • 不同的数据库产品将具有不同的特性,MySQL对于某些worlkoad可能非常快,而对于其他worlkoad则非常慢.

这篇关于数据库设计可处理大量数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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