本文介绍了如何存储20亿用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个有20亿用户注册的门户。如果您将所有20亿用户存储在常规数据库中,则在用户尝试登录时,需要更多时间才能检索特定用户的数据。您如何处理这种情况,以确保用户快速获得响应。

解决方案

我没有看到任何特定的原因为什么体面的现代硬件的传统数据库不能很快地检索登录信息,即使你有20亿条记录。这完全是一个简单的索引查找(你确实记得在用户ID上索引,对吗?)



在一台很大的机器上,你甚至可以将它大部分放在RAM



然而,如果你真的试图用这个规模进行设计,我会看到像这是一个高度可用的分布式NoSQL数据库,基本上与Google,Facebook等将使用相同的架构。


There is a portal with two billion users registered. If you store all the 2 billion users in a conventional databases it will take more time to retrieve the data about a particular user when that user tries to login. How do you handle this situation to make sure that the user gets the response quickly.

解决方案

I don't see any particular reason why a conventional database on decent modern hardware couldn't retrieve log-on information pretty quickly, even if you have 2 billion records. It's just a simple indexed lookup after all (you did remember to index on user ID, right?)

On a really big machine you might even fit most of it in RAM.

However, if you are really trying to engineer this for scale I'd look at something like Cassandra. This is a highly available, distributed NoSQL database, basically the same kind of architecture that Google, Facebook etc. would use.

这篇关于如何存储20亿用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 21:36