📜 ⬆️ ⬇️

WhatsApp architecture Facebook bought for $ 19 billion

Once again, I want to offer my translation of the article, this time by Todd Hoff, and his article is devoted to WhatsApp architecture at the time of his purchase of Facebook.


Remark: the beginning of the article contains the reasoning of the author of the original about why Facebook bought WhatsApp for a fabulous 19 billion. If this is not interesting to you - just scroll through, the description of the architecture will be below.


Rick Reed in his upcoming March report entitled "A Billion with a Big 'M': The Next Level of Scaling in WhatsApp" reveals the stunning WhatsApp statistics:


What has hundreds of nodes, thousands of cores, hundreds of terabytes of RAM and hopes to serve billions of smartphones that will soon become a reality around the world? Erlang and FreeBSD-based WhatsApp architecture. We encountered many difficulties in meeting the ever-growing demand for our messaging service, but we continue to expand our system in terms of size (> 8000 cores) and in terms of speed (> 70M Erlang messages per second).

But since we do not yet have this report, let's look at the report that Rick Reed made two years ago: "Scaling to millions of simultaneous connections . "


With experience in developing high-performance messaging bus in C ++ at Yahoo, Rick Reed is no stranger to the world of scalable architectures. The founders of WhatsApp are also former Yahoo employees with considerable experience in scaling systems. So whatsapp works due to their scaling skills. And since their Big Bold goal is to be on every smartphone in the world, of which there will be about 5 billion in a few years, they will need all this experience.


Before we get to the facts, let's digress to this astounding riddle: how could WhatsApp ever be valued by Facebook at $ 19 billion?


If you ask me, as a programmer, if WhatsApp is worth such money, I will answer that, of course, no! It's just sending data over the network! Well really. True, I am one of those who believe that the blog platform is not needed, because there is nothing difficult in connecting remotely to the server, opening index.html using vi and writing your post in HTML. It took me a while to understand that development is not writing stupid code, it is a way to make all those users love your product, which is the most difficult. Love can not buy.


So what makes WhatsApp so valuable? Technology? Do not pay attention to those who say that in a week they will be able to write WhatsApp in PHP. This is simply not true. As we will see, this is a very cool technology. But, of course, Facebook has enough resources to develop WhatsApp, if they wanted.


Let's look at the features. We all know that WhatsApp is a product without tricks (no ads, games, tricks) with dedicated users all over the world . He offers free messages in a harsh world where SMS bills can be terrible. As a visiting American, I was very surprised at how many real people use WhatsApp to really stay in touch with their family and friends. So when you take WhatsApp, it’s likely that the people you know are already there, since everyone has a phone that eliminates the problem of an empty social network. It is aggressively cross-platform, so that everyone you know can use it and it will just work. The phrase he "just works" is often used. It has all the features (you can share location, sound, video, pictures, push-to-talk, voice messages and photos, delivery notification, group chats, sending messages via WiFi, and all this can be done regardless of addressee or not). It also supports the display of national writing systems. And the use of a mobile phone number as an identifier and contacts as a social graph is devilishly simple. No confirmation by email, username and password, no credit card number required. It just works.


It's all cool, but it's not worth $ 19 billion. Other products can compete with them in terms of features.


The possible reason is that Google wanted to buy WhatsApp , offering 99 cents per user. This is a threat to Facebook, they are just desperate . This money is offered for your phone book and for metadata (even considering that WhatsApp does not store them).


This is over 450 million active users with a million growth every day and a potential of a billion users. Facebook needs WhatsApp to get the next billion users. But if so, then this is only a part. And the price of about $ 40 per user does not look inadequate, especially when paying for shares. Facebook bought Instagram for $ 30 per user . Twitter user costs $ 110 .


Benedict Evans claims that the mobile market is over a trillion dollars, and WhatsApp is undermining the SMS industry, which generates $ 100 billion in revenue by sending 18 billion messages a day, while only 20 billion SMS are sent globally. With the fundamental transition from personal computers to almost universal smartphones, the size of opportunities is much larger than the target market than the one that is familiar to Facebook.


But Facebook promised that there would be no advertising, no association of services, so what's the benefit?


There is an interesting business development through the use of mobile technologies . WhatsApp is used to create group discussions with project teams, and investors discuss the progress of transactions through WhatsApp.


Instagram is used in Kuwait for the sheep trade .


WeChat, a competitor to WhatsApp, launched a taxi hire service in January, for the first month 21 million cars were hired.


With the future of e-commerce sent by mobile apps to send messages, is it worth playing this field?


Not only business uses WhatsApp for tasks that were once solved by desktop or web applications. Spanish police use WhatsApp to catch criminals, Italians organize basketball teams with his help.


Commercial and other applications are moving to mobile phones for obvious reasons. Everyone has a phone, and these instant messengers are full of features, free and cheap to use. You no longer need a desktop computer to do business. Many functions can be overridden by the mobile application.


Thus, instant messaging is a threat to Google and Facebook. Desktop computers are dead. The web is dying. Instant messaging + mobile technology is an ecosystem that can replace them . Instant messaging has become the focus of interaction in mobile technology, rather than search, by changing the search and nature of which applications will conquer the future. We are not just anticipating PageRank, we are anticipating the web.


Facebook should get into this market, or become useless.


With the transition to the mobile, we see the deportalization of Facebook. Its desktop interface is a portal that provides access to all features of the backend. He is big, tangled and squeaky. Who likes the Facebook interface at all?


When Facebook came to mobile devices, they tried the portal approach and it did not work. So they moved to the strategy of small, more focused applications for a single task . Mobile first! Not much can be done on the small screen. On a mobile phone, it is easier to find a separate application than a menu buried deep in the depths of a confusing portal application.


But Facebook goes one step further. Not only do they develop individual applications for specific tasks, they provide several competing applications that provide similar functionality, and these applications do not necessarily have a common backend. We see this in the example of WhatsApp and Messenger, and Instagram competes with photos on Facebook. Paper is an alternative Facebook interface that provides limited functionality, but what it does, it does well.


Conway’s law may apply here. The idea is that "organizations, design systems ... usually generate an architecture that replicates the communication structure of these organizations." With a monolithic backend infrastructure, we get a portal design similar to Borg . The transition to mobile technology frees organizations from such thinking. If applications that use only part of the Facebook infrastructure can be developed, then applications that do not use the Facebook infrastructure at all can be developed. And if they do not use the Facebook infrastructure, then they may not be developed on Facebook. What then is Facebook?


Facebook CEO Mark Zuckerberg has his own point of view, voiced at the Mobile World Congress conference, that the WhatsApp takeover is closely related to Internet.org:


The idea is to develop a set of basic free Internet services - "911 Internet". It could be a social network, like Facebook, an instant messenger, maybe a search, and other things, like the weather. The set of these free services will work as a kind of drug - users who can afford data services and phones simply do not see the point in paying for these services. This will give them some context that will show them why services are important and this will encourage them to pay for other similar services - there is such hope.

It is a long game, but it contains enough values ​​to make sense to play it.


Have we come to an agreement? I do not think. This is an amazing amount of dollars, the short-term benefits of which are not obvious, so the explanation of how long-term play makes some sense. We are still at the dawn of mobile technology. No one knows what the future will look like, so it’s better not to try to make the future look like the past. Facebook seems to be doing just that.


But enough of that. How would you serve 450 million active users with just 32 engineers? Let's get a look...


Sources


Warning: we know not so much about whatsapp architecture as a whole. Just fragments and scraps collected from various sources. Rick Reed's talk is about optimization, which allowed to process 2 million connections on a single server using Erlang, rather than a review of the entire architecture.



Statistics


These statistics are mainly for the current system, and not for the system about which we have a report. A report on the current system will include more hack information for data storage, messaging, meta-clustering, and more patches for BEAM / OTP.



Platform


Backend



Product



General



The challenge of 2+ million connections per server



Tools and technologies used to increase scalability



Lessons





.


')

Source: https://habr.com/ru/post/276951/


All Articles