简体   繁体   English

数百万条目的数据库设计

[英]Database design with millions of entry

Suppose there is a messaging system. 假设有一个消息传递系统。 This system has millions of entry to be sent and get reported and the count is growing by 100K every hour. 该系统具有数以百万计的条目要发送和得到报告,并且计数每小时增长10万。 2 service accesses db, one is sender, one is reporter. 2个服务访问db,一个是发送者,一个是报告者。 So what would you suggest in order to get maximum performance? 那么,为了获得最佳性能,您会提出什么建议? How could the db be designed? 数据库如何设计?

Also what open source RDBMS would you suggest among mysql, postgresql, mongodb etc. to fullfil this high volume db? 您还建议在mysql,postgresql,mongodb等中使用什么开源RDBMS来填充此高容量数据库?

Thanks 谢谢

You've not really provided much information on your requirement other than a few comments about expected data volumes. 除了关于预期数据量的一些注释之外,您实际上没有提供太多有关需求的信息。 Simple storage of large volumes of data has no real intrinsic value, it's the ability to access that data which gives the real value; 简单地存储大量数据没有真正的内在价值,访问具有真正价值的数据的能力就在于此。 so knowing how you expected to retrieve information from the database is more important than how much data you want to store. 因此,了解您期望如何从数据库中检索信息比要存储多少数据更为重要。

Do these messages really require a document db like MongDB, or are are they structured enough to use a straight RDBMS like Postgresql or MySQL. 这些消息是否确实需要像MongDB这样的文档数据库,或者它们的结构是否足以使用Postgresql或MySQL这样的直接RDBMS。 Do you need full text search capability? 您需要全文搜索功能吗? How often and what type of queries are executed against this message data? 针对此消息数据执行多久一次以及执行哪种类型的查询? Are you trying to write your own Twitter? 您是否要编写自己的Twitter?

If those are your current data volumes, look to using db replication for resilience. 如果这些是您当前的数据量,请考虑使用数据库复制来增强弹性。 Consider partitioning your message table, perhaps by date posted. 考虑对消息表进行分区,也许按发布日期进行分区。 Use master/slave (or even multi-master/multi-slave) as Konerak has suggested. 按照Konerak的建议使用主/从(甚至是多主/多从)。 Look at the possibilities of an archive table for older messages that are less likely to be queried, but which are then still available. 查看为较旧的消息创建归档表的可能性,这些消息不太可能被查询,但是仍然可用。 Look at what a commercial database like Oracle can offer you. 看看像Oracle这样的商业数据库可以为您提供什么。 Get in a professional to help tune the db for performance, rather than simply asking for free advice on sites like SO. 找专业人员来帮助调整数据库的性能,而不是简单地在SO之类的网站上寻求免费建议。

Consider your hardware as well... multiple load balanced servers to help with the volumes (we have 14 dedicated servers purely for accepting new messages, and three high performance servers tuned for querying the data). 还要考虑您的硬件...多个负载平衡的服务器来帮助处理卷(我们有14台专用服务器仅用于接收新消息,而三台高性能服务器已调整用于查询数据)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM