Aditya Agarwal, Director de Ingenieía de Facebook, dio una excelente conferencia acerca del escalamiento en Facebook que cubrio su arquitectura, pero la charla realmente fue más sobre como escalar una organizacion preservando lo mejor de su cultura. La clave de la conferencia es:
You can get the code right, you can get the products right, but you need to get the culture right first. If you don’t get the culture right then your company won’t scale.
Puedes tener el codigo bien, puedes tener los productos bien, pero necesitas tener bien la cultura primero. Si no tienes bien la cultura entonces la compañia no podrá escalar
Esto nos lleva a los 4 secretos de escalabilidad en Facebook:
Estas son algunas consideraciones antes de hablar sobre cada uno de los cuatro secretos en Facebook:
Facebook es muy grande
400 millones de usuarios actuvos; los usuarios utilizan facebook 20 minutos al dia en promedio; 5 billones de piezas de contenido (actualizaciones de estado, comentarios, gustos, carga de fotos, carga de videos, mensajes de chat, mensajes de correo, eventos, paginas de fans, conexiones de amigos) son compartidas en facebook cada semana; 3 billones de fotos cargadas cada mes; 250 aplicaciones que tienen mas de 1 millon de usuarios al mes; 80.000 conexiones de aplicacion, 500.000 aplicaciones; 2 millones de desarrolladores; 150 millones de operaciones por segundo en memcache; miles de servidores de memcache con decenas de Terabytes en memoria.
Facebook es dificil de escalar
Cada tipo de contenido tiene su propio patrón de acceso lo cual hace dificil el escalamiento. Todos usan Facebook de una manera diferente. Cada experiencia de usuario es unica. La mayoria de sitios web escalan de manera horizontal, porque su data puede ser particionada. En Facebook los usuarios no pueden ser particionados porque pueden unirse a cualquier red, Facebook es una red global que trata de cautivar a todo el mundo, permite a cualquiera ser amigo de cualquiera, y puede representar cualquier relación entre usuarios. cada usuario nuevo puede acceder los datos de cualquier otro usuario por lo tanto no se puede particionar geograficamente o por otra tipo de criterio. En promedio, cada usuario de Facebook tiene 130 amigos.
La arquitectura tiene 4 componentes principales
1. Escalamiento necesita Iteración. Las soluciones por lo general funcionan al principio, pero deben ser modificadas a medida que pasa el tiempo. Lo que funciona en el primer año, podria no funcionar despues. PHP, por ejemplo, es simple usarlo al principio, pero no es una buena elección cuando se tienen miles de webservers.
Otro ejemplo son las fotos, actualmente sirven 1.2 millones de fotos por segundo. La primera versión se creo de la manera facil, sin preocuparse ucho por como escalaba, simplemente enfocandose en que funcionara bien. El cargador almacenaba el archivo en un NFS y la meta-data en MySql, funciono bien los 3 primeros meses y causo muchas noches sin poder dormir, aun lo hace. El Time to market, o tiempo para salir al mercado fue la ventaja más competitiva que se tenia, tener la funcionalidad era más importante que si esta escalaba bien o no.
La segunda fase fue la optimización, se evidencio que las imagenes pequeñas son mas accesadas por lo cual se empezaron a almacenar en cache, además empezaron a usar un CDN, el servicio NFS no fue diseñado para almacenar 80 billones de pequeños archivos, asi que toda la meta-data no se ajustaba a la memoria, por lo cual eran necesarios 2 o 3 IOs a disco, lo cual era lento.
La tercera fase es un sistema que crea un archivo que es un BLOB almacenado en el sistema de archivos. Las imagenes son almacenadas en un BLOB y se conoce el offset de la foto en el BLOB para su recuperacion, esto se traduce en 1 IO por cada foto.
2. No sobredimensione. Unicamente utilice lo necesario a medida que va escalando. Descubra donde debe iterar en una solución, optimice o construya la solución usted mismo. Ellos dedicaron mucho tiempo tratando de optimizar PHP, terminaron escribiendo HipHop, un transformador de código que convierte PHP en C++, lo cual genero una cantidad masiva de ahorro en CPU y memoria. Esto no debe ser realizado en el dia 1, pero deberia, enfoquese primero en el producto antes de escribir un lengueaje nuevo por completo.
3. Escoja la mejor herramienta, pero tenga en cuenta que traerá consigo otras consideraciones. Si usted realmente necesita usar Python adelante, pero tenga en cuenta que tendrá su costo, usualmente en instalación, monitoreo, operación. Si usted decide usar una arquitectura basada en servicios, tendrá que construir la mayoria del backend usted mismo y eso toma tiempo, con LAMP por ejemplo tiene todo esto gratis. A medida que incursiona en el alcance por servicios, tendrá que reinventar la rueda.
4. Ajuste la cultura. Muevase rapido – rompa paradigmas. Alto Impacto – equipos pequeños. Sea valiente – innove. Construya un ambiente interno que promueva la construcción correcta de las funcionalidades y despues se optimicen segun sea necesario, sin preocuparse por la innovación, sin preocuparse por romper paradigmas, pensando en grande, pensando en que será lo siguiente en construir despues de este primer paso. Usted puede tener el codigo correcto, los productos correctos, pero si la cultura no es la apropiada no podrá escalar de manera eficiente.
En Facebook no hay dueños del producto, todos son dueños del producto. Dele a la gente apropiación de lo que hacen, si solo una persona obtiene el crédito, entonces nadie contribuira para llevar el producto al siguiente nivel. Las ideas vienen internamente de los usuarios y las personas, si la responsabilidad no esta distribuida y solo un número de personas siente que son parte del producto, entonces solo ellos serán suceptibles de ser motivados. Moverse rápido no es solo un deseable, las compañias deben encontrar maneras para que la gente sienta que es una realidad.
A continuación les dejo el link donde pueden ver el video completo de la conferencia :
http://www.infoq.com/presentations/Scale-at-Facebook
Tags: arquitectura, blob, C++, cdn, escalabilidad, Facebook, hackatons, HipHop, IO, LAMP, MySql, NFS, php, Python, scale, server, web, webserver
Glad i found this excellent website, Another good site is Dbol will be sure to bookmark it so i can surf to often.
Ecstatic i came across this site, Another good site is Dbol will make sure to book mark it so i can stop by regularly.
Glad i found this excellent website, Another good site is Dbol will be sure to bookmark it so i can surf to often.
Lucky i uncovered this site, Another good site is Dbol will be sure to bookmark it so i can come by routinely.
Bookmarking now cheers, definitely consider a follow up post.
I enjoyed seeing this, are you on twitter?
Thankful i recently uncovered this excellent website, Another good site is Dbol will be sure to save it so i can browse frequently.
Glad i found this excellent website, Another good site is Dbol will be sure to bookmark it so i can surf to often.
What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.
Thanks so much for writing all of the excellent information! Looking forward to checking out more posts!
Whats up, fantastic blog! I’ve applied this procedure a range of instances already and i’ve had fantastic benefits. All dentists really should consider be aware of this. Quickly with a excellent finish outcome, what far more could you want? Thank you
This is a really good blog. Thanks for the info.
It was interesting. You seem very knowledgeable in your field.
Useful information shared..Iam very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post.
How to save money on credit cards?
Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep ‘em coming… you all do such a great job at such Concepts… can’t tell you how much I, for one appreciate all you do!
Overall health is achieved through a combination of physical, mental, and social well-being, which, together is commonly referred to as the Health Triangle.
If you could e-mail me with a few hints on how you made your blog look this excellent, I would be grateful.
This web site does not render properly on my i phone – you may want to try and fix that
This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article
That fantabulous post this has been. Within no way seen this kind associated with useful post. I’m grateful to you and anticipate much more associated with posts such as. Thank you very much.
Once I came over to this article I can only see part of it, is this my internet internet browser or the internet web site? Should I restart?
I just added this web site to my google reader, great stuff. Can’t get enough!
Worthwhile info and excellent design you got right here! I wish to thank you for sharing your ideas and putting the time into the stuff you publish! Good job!
Los 4 secretos de escalabilidad en Facebook | Infraestructura y Servicios was a good post, thanks for sharing this enlightening news. It is always good when you can’t solely be informed, but in addition be entertained! I will visit your weblog recurrently for the most recent articles.
This webpage doesn’t render appropriately on my iphone4 – you might want to try and repair that
I appreciate your wp web template, exactly where do you down load it through?
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information. wajadud555
Great stuff from you, man. Ive read your stuff before and youre just too awesome. I love what youve got here, love what youre saying and the way you say it. You make it entertaining and you still manage to keep it smart. I cant wait to read more from you. This is really a great blog. wajadud555
Your website won’t show up correctly on my iphone 3gs – you may want to try and repair that
Superb blog post, I’ve bookmarked this web page so with any luck , I’ll discover more on this topic in the future!
This will be a excellent web site, would you be interested in doing an interview regarding just how you created it? If so e-mail me!
This is a terrific web page, would you be interested in doing an interview about how you created it? If so e-mail me!
Thank you, I’ve recently been searching for information about this subject matter for ages and yours is the best I have found so far.
Terrific article, I’ve book marked this website so with any luck , I’ll see a lot more on this subject in the future!
naklejki ścienne to wspaniałe dekoracje do mieszkania naklejki na ściany ornamenty architektura naklejki scienne
naklejki ścienne to wspaniałe dekoracje do mieszkania naklejki na ściany ornamenty architektura naklejki scienne
It is a really great read for me, should admit that you are among the best bloggers I have seen. Thank you for posting this educational post Los 4 secretos de escalabilidad en Facebook | Infraestructura y Servicios. Keep up the nice work, I have added you to my blogroll.
Reading this article Los 4 secretos de escalabilidad en Facebook | Infraestructura y Servicios jogs my memory of my previous roommate! He always kept talking about this. I’ll forward this post to him. Pretty sure he will have a superb read. Thanks for the knowledge you post.
Nice site, nice and easy on the eyes and great content too.
This is a really excellent read for me, should admit that you are among the best bloggers I have seen. Thanks for posting this educational article Los 4 secretos de escalabilidad en Facebook | Infraestructura y Servicios. Carry on the good work, I’ve added you to my blogroll.
This is such an incredible useful resource that you are offering and you give it away for free. I like seeing websites that perceive the worth of providing a top quality useful resource for free. Nice work!
Hey very nice blog!! Man .. Beautiful .. Amazing .. I will bookmark your blog and take the feeds also…
It was interesting. You seem very knowledgeable in ypour field.
Hello – I must say, I’m impressed with your site. I had no trouble navigating through all the tabs and information was very easy to access. I found what I wanted in no time at all. Pretty awesome. Would appreciate it if you add forums or something, it would be a perfect way for your clients to interact. Great job
Thanks for writing this. I really feel as though I know so much more about this than I did before. Your blog really brought some things to light that I never would have thought about before reading it. You should continue this, Im sure most people would agree youve got a gift.
Terrific read! I have got 1 suggestion for your webpage. It looks like there are some style sheet troubles when launching several web pages in google chrome and firefox. It is functioning good in internet explorer. Maybe you can double check that. I have just book marked this document on digg.com to acquire a few more readers to your site.
Howdy, i have just book marked this document on my facebook account and received a good deal of positive reactions! I feel you are genuinely doing a wonderful job with your weblog. I have got one question though, this is a blogengine website correct?
Que buen articulo, no sabia ese tipo de cosas de Facebook. Me gustaria ver más articulos de este tipo!!
[...] This post was mentioned on Twitter by Carlos Castillo, conso.la. conso.la said: Los 4 secretos de escalabilidad en Facebook http://digs.by/9PXRZZ [...]