Facebook架构 [英] Facebook Architecture

查看:143
本文介绍了Facebook架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在搜索关于Facebook的架构的文章/信息,挑战与挑战他们应对的方式他们用什么为什么他们使用他们如何扩展&他们做什么的设计决定等等。主要的基础是学习。了解处理这种大量流量的网站,在设计新网站时,会为建筑师等提供许多指标,以便牢记某些内容。我正在分享我发现的东西。

I have been scrounging for articles/info about the architecture at Facebook, the challenges & ways they tackle them. What they use & why they use. How do they scale & what are the design decisions for what they do etc. Main underpinning being to learn. Knowing about sites which handles such massive traffic gives lots of pointers for architects etc. to keep in mind certain stuff while designing new sites. I am sharing what I found.


  1. Facebook Science&社交图(视频)

  2. 在Facebook上缩放

  3. Facebook Chat Architecture

  4. Facebook Blog

  5. Facebook Cassandra架构与设计

  6. Facebook工程备注

  7. Quora - Facebook架构

  8. 600M用户的Facebook

  9. Hadoop&其在Facebook上的使用

  10. 在Facebook上的Erlang:聊天架构

  11. Facebook性能缓存

  12. Facebook连接体系结构

  1. Facebook Science & Social Graph (Video)
  2. Scale at Facebook
  3. Facebook Chat Architecture
  4. Facebook Blog
  5. Facebook Cassandra Architecture and Design
  6. Facebook Engineering Notes
  7. Quora - Facebook Architecture
  8. Facebook for 600M users
  9. Hadoop & its usage at Facebook
  10. Erlang at Facebook: Chat Architecture
  11. Facebook Performance Caching
  12. Facebook Connect Architecture

我有2个以上的链接,但由于本网站的限制,无法发布。另外,如果有任何人更好,请分享(不需要与Facebook相关)。

I have 2 more links but unable to post due to restrictions at this site. Also, please share if anyone has anything better (need not be related to Facebook only).

P.S。 - 我无法找到分享这个研究的好地方,因此这个举措。希望这有助于某人。

P.S. - I wasn't able to find good places to share this research, hence this initiative. Hope this helps someone.

推荐答案

嗯,Facebook经历了很多变化,并不是最初设计得很有效率。它的目的是做到这一点。我完全不知道代码是什么样的,你可能不会找到很多信息(由于显而易见的安全性和版权原因),只是看看API。看看它有多频繁变化,多少次不能正常工作,或者甚至一切。

Well Facebook has undergone MANY many changes and it wasn't originally designed to be efficient. It was designed to do it's job. I have absolutely no idea what the code looks like and you probably won't find much info about it (for obvious security and copyright reasons), but just take a look at the API. Look at how often it changes and how much of it doesn't work properly, anymore, or at all.

我认为他们最大的a​​ce是Hiphop。
http://developers.facebook.com/blog/post/358
您可以自己使用HipHop:
http://wiki.github.com / facebook / hiphop-php

I think the biggest ace up their sleeve is the Hiphop. http://developers.facebook.com/blog/post/358 You can use HipHop yourself: http://wiki.github.com/facebook/hiphop-php

但是,如果你问我这是一个非常有抱负的,可能是浪费时间的任务。嘻哈只支持这么多,它不能简单地将所有内容转换成C ++。那么这告诉我们什么?那么它告诉我们,Facebook并没有充分利用PHP语言。它不是使用最新的5.3,我愿意打赌还有很多是PHP 4兼容。否则,他们不能使用HipHop。 HipHop是一个很好的IDEA,需要成长和扩展,但在目前的状态下,对于正在构建新的PHP应用程序的许多人来说,这并不真正有用。

But if you ask me it's a very ambitious and probably time wasting task. Hiphop only supports so much, it can't simply convert everything to C++. So what does this tell us? Well, it tells us that Facebook is NOT fully taking advantage of the PHP language. It's not using the latest 5.3 and I'm willing to bet there's still a lot that is PHP 4 compatible. Otherwise, they couldn't use HipHop. HipHop IS A GOOD IDEA and needs to grow and expand, but in it's current state it's not really useful for that many people who are building NEW PHP apps.

还有PHP通过像Resin / Quercus这样的东西到JAVA。再次,它不支持所有...

There's also PHP to JAVA via things like Resin/Quercus. Again, it doesn't support everything...

另外需要注意的是,如果您使用任何非标准PHP模块,您将无法将该代码转换为C ++或Java。不过我们来看看PHP模块。它们是用C ++编译的。因此,如果您可以构建执行操作的PHP模块(如解析XML等),那么您基本上(减去一些交互)以相同的速度工作。当然,你不仅可以为每一个可能的需求和整个应用程序制作一个PHP模块,因为你必须重新编译,而且编码的难度等等。

Another thing to note is that if you use any non-standard PHP module, you aren't going to be able to convert that code to C++ or Java either. However...Let's take a look at PHP modules. They are ARE compiled in C++. So if you can build PHP modules that do things (like parse XML, etc.) then you are basically (minus some interaction) working at the same speed. Of course you can't just make a PHP module for every possible need and your entire app because you would have to recompile and it would be much more difficult to code, etc.

但是...有一些方便的PHP模块可以帮助您解决速度问题。
虽然在一天结束的时候,我们有一个被称为云的真棒,我们可以扩展我们的应用程序(包括PHP),因此它不再重要。硬件变得越来越便宜。亚马逊只是降低了它的价格(再次)。

However...There are some handy PHP modules that can help with speed concerns. Though at the end of the day, we have this awesome thing known as "the cloud" and with it, we can scale our applications (PHP included) so it doesn't matter as much anymore. Hardware is becoming cheaper and cheaper. Amazon just lowered it's prices (again) speaking of.

所以只要你编写你的PHP应用程序的想法,它将需要一天的规模...然后我觉得你很好,我不确定我甚至不会看Facebook,他们做了什么,因为当他们这样做的时候,这是一个完全不同的世界,现在试图坚持这个基础设施并保持它嗯,你得到的东西像HipHop。

So as long as you code your PHP app around the idea that it will need to one day scale...Then I think you're fine and I'm not really sure I'd even look at Facebook and what they did because when they did it, it was a completely different world and now trying to hold up that infrastructure and maintain it...Well, you get things like HipHop.

现在HipHop如何帮助您?不会。它不行你刚刚开始,你可以使用PHP 5.3。我强烈建议您查看PHP 5.3框架以及PHP 5.3与SPL库一起提供的所有新功能,并考虑您的数据库。您很可能从数据库提供内容,因此请查看MongoDB和其他类型的无模式和面向文档的数据库。它们对于最常见的网站/应用来说要快得多,更好。

Now how is HipHop going to help you? It won't. It can't. You're starting fresh, you can use PHP 5.3. I'd highly recommend looking into PHP 5.3 frameworks and all the new benefits that PHP 5.3 brings to the table along with the SPL libraries and also think about your database too. You're most likely serving up content from a database, so check out MongoDB and other types of databases that are schema-less and document-oriented. They are much much faster and better for the most "common" type of web site/app.

看看Foursquare和Smugmug等新兴公司以及正在使用新技术的其他公司,以及他们如何使用它们。对于像Facebook一样成功,我老实说,不要看他们如何建立一个高效的网站/应用程序。我不是说他们没有非常(非常)有才华的人在那里工作,创造性地解决(他们)的问题...我也不是说Facebook不是一个好主意,而是不是成功,你不应该从中获得想法....我只是说如果你可以查看他们的整个源代码,你可能不会从中受益。

Look at NEW companies like Foursquare and Smugmug and some other companies that are utilizing NEW technology and HOW they are using it. For as successful as Facebook is, I honestly would not look at them for "how" to build an efficient web site/app. I'm not saying they don't have very (very) talented people that work there that are solving (their) problems creatively...I'm also not saying that Facebook isn't a great idea in general and that it's not successful and that you shouldn't get ideas from it....I'm just saying that if you could view their entire source code, you probably wouldn't benefit from it.

这篇关于Facebook架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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