News for hackers. Stuff that matters.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by sidcool on Wednesday September 16, 2015 @07:59AM (#10225931)
Comments in this thread are quite cringeworthy. People calling WhatsApp a simple application seem to fail to understand the cost of simplicity under such scale.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by smcl on Wednesday September 16, 2015 @12:39PM (#10227876)
I don't think anyone commenting along these lines on HN is that ignorant. Everyone on here understands that anything executed at the WhatsApp/FB/Instagram sort of scale is going to present all sorts of tough problems and require software engineering know-how in spades.

However of all the various applications you could conceivably scale to hundreds of millions of users this is one of the simplest. I do not think acknowledging that is cringeworthy at all.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by lotso on Wednesday September 16, 2015 @12:48PM (#10227957)
>However of all the various applications you could conceivably scale to hundreds of millions of users this is one of the simplest. I do not think acknowledging that is cringeworthy at all.

What other apps besides social networking and communication apps even get to hundreds of millions of user?

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by gallamine on Wednesday September 16, 2015 @12:59PM (#10228046)
I guess "users" is a confusing concept, but a service like Cloudflare would be an example of a more complex application serving that scale of people.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by tedunangst on Wednesday September 16, 2015 @02:30PM (#10228733)
Is cloudflare more complex or less? If I'm connecting through a CF proxy in North America and someone else is connecting through Europe, there's not really any state that needs to be synchronized between us. If I send a message to somebody in Europe, that obviously does need to be synced.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by simcop2387 on Wednesday September 16, 2015 @02:34PM (#10228762)
Actually there is state that might need to be synchronized between the two locations. The cached state of the page or other resources there. CF doesn't just do a blind proxy to the host, along with that it does a number of checks for common attacks and other misbehaving clients.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by tedunangst on Wednesday September 16, 2015 @02:47PM (#10228830)
The NA data center can't decide how long to cache a page without consulting EU (and Asia, and SA, and etc.)? Obviously there is some shared global state (how else would each endpoint know where to proxy to?), but it seems unlikely every request passing through CF is mutating the same global database.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by fapjacks on Wednesday September 16, 2015 @04:30PM (#10229636)
Having tossed the towel in trying to build a global CDN/caching system with relatively few endpoints some years ago, I can tell you that it's very complex. I can't speak to the complexity of something like WhatsApp, and so any comparison would be totally ignorant and anecdotal, but I am guessing that CloudFlare is orders of magnitude more complex than WhatsApp.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by chaosmonkey on Wednesday September 16, 2015 @01:09PM (#10228147)
Search?
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by spyder on Thursday September 17, 2015 @12:44AM (#10231617)
Photo and video sharing/storage apps with the problem of storing huge amounts of data + most of them includes the communication part too (comments). If I remember correctly WhatsApp doesn't even stores the text messages.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by nhaehnle on Wednesday September 16, 2015 @03:00PM (#10228932)
There's still a big difference between WhatsApp and the likes of Facebook when it comes to complexity. Last I checked, WhatsApp does not do face recognition, to pick an example at random.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by gaius on Wednesday September 16, 2015 @05:01PM (#10229833)
I'll wager the complexity of WhatsApp is not 1% of 1% of Amazon.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by KirinDave on Wednesday September 16, 2015 @01:27PM (#10228282)
> I don't think anyone commenting along these lines on HN is that ignorant.

You are quite the optimist.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by mpdehaan2 on Wednesday September 16, 2015 @08:08AM (#10225967)
It wasn't a great article from wired. I feel the language choice is probably the least contributing factor in terms of what's interesting at that scale. Yes, it's an eclectic choice, but I find systems/component architecture much more interesting than language and program architecture in scaling considerations.

A bit more info here: http://highscalability.com/blog/2014/3/31/how-whatsapp-grew-...

With regard to fun challenges to solve, from that article:

"Lots of problems related to scale as you might imagine. Problems with flapping connections, queues getting so long they delay high priority operations, flapping of timers, code that worked just fine at one traffic level breaking badly at higher traffic levels, high priority messages not getting serviced under high load, operations blocking other operations in unexpected ways, failures causing resources issues, and so on. These things just happen and have to be worked through no matter what system you are using."

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by rdtsc on Wednesday September 16, 2015 @11:42AM (#10227431)
I don't know I found the article decent _for_ being on wired. Didn't expect BEAM VM internals there...

> I feel the language choice is probably the least contributing factor in terms of what's interesting at that scale.

However, as they say "right from the horses' mouths", WhatsApp engineers have said that Erlang and FreeBSD are critical tools for their success. One can accuse them of lying, of course, but why?

Here is an interview with Eugene Fooksman:

https://pdincau.wordpress.com/2013/03/27/an-interview-with-e....

---

...and the consensus in our team is that it is largely because of Erlang. We’re managing to serve huge amount of connections from single front-end server...

---

There is the "That A Billion With A 'B'" talk by Rick Reed at Erlang Factory (already posted somewhere) in here.

Here is another older directly from their website:

https://blog.whatsapp.com/196/1-million-is-so-2011

Clearly states Erlang and FreeBSD are important.

> These things just happen and have to be worked through no matter what system you are using.

Yeah but that is a bit too generalizing. It is like saying "well the language is Turing Complete" argument, yet it is but one tool is much better than another. Surely Twitter runs on JVM, Google doesn't use Erlang etc etc. So you can do it many other ways. And, at least in this case, they certainly picked the right tools, as we can see from their success. The number of users * amount of messages processed / # of engineers is a not a bad metric to see how good a tool is. And Erlang is a great tool here.

(Another example is when you use the smartphone to access the Internet, chances are 50% of the time that connection is set up by Erlang. It is there in the background doing its job, not crashing, setting up even an order of magnitude larger amount of data than we see from WhatsApp).

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by mpdehaan2 on Tuesday September 22, 2015 @10:00AM (#10258581)
"One can accuse them of lying, of course, but why?"

I never said that.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by austenallred on Wednesday September 16, 2015 @11:06AM (#10227137)
I posted this on /r/programming earlier, and there was a fantastic response from /u/MyTribeCalledQuest.

It's here https://www.reddit.com/r/programming/comments/3l2spe/why_wha...

In its entirety:

I can explain a bit more in depth than the author did.

Erlang uses a model known as the actor model. This means that each part of your program is a completely independent entity like a mailbox, known as an actor. For one actor to communicate with another actor, it simply puts a message in the intended actor's mailbox. Since each actor is independent, this means that we can spawn as many actors as we want to read messages from a single mailbox, and do what is requested.

In terms of what WhatsApp is doing, this means that they can have (potentially infinite) conversations going on between users all at the same time. If any part of their pipeline is working too slowly (there are more messages being put in the mailbox than taken out) they can just spawn additional actors to read mail (at any time they want, even programmatically). Additionally, as alluded to by the author, in Erlang you can do something known as "hot loading," which means spawning newer versions of actors (when the implementation changes) while still running the old actors so that there is never any loss of service.

Haskell is similar to Erlang in its ability to scale. In fact, there is a library in Haskell known as HdpH-RS that enables fault-tolerant (the programmer does not have to worry about intermediate failure at all) distributed computing/memory (tested up to 1400 cores). The main reason for this is that Haskell is strictly-typed, meaning all types must be defined (or derivable) at compile time, and immutable, meaning that variables cannot change their values after they are defined.

Due to all of this strictness, you never have to worry about errors found in languages like C such as segfaults, or improper use of a function since you can enforce usage with types. For instance a function that should only accept unit vectors would use a type UnitVector instead of Vector (Note that this approach is generally a bad idea in C/C++/Java etc). Essentially, if your program compiles, then it will run correctly (generally the only real errors you run into are logical ones -- the algorithm itself being incorrect). This makes it really easy to refactor code later on. The reason Facebook can handle urgent tasks so quickly is mostly due to Haskell's generics, which are like templates from C++ or generics in Java. The main difference however is that Haskell lets you create generic mixins for types known as type classes. This means that you can write extremely general code to handle almost anything in the high level. Then, whenever you need to handle something new, you just have to choose which mixins you want and just add them to your type by defining the interface. For example, I could make a Multipliable type class, I would require the programmer to only define the multiplication operator for his type, and then it would automatically create things like pow or sqr.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by fanf2 on Thursday September 17, 2015 @08:09PM (#10236833)
That comment's description of Erlang is wrong.

In Erlang, message queues are tied to processes. You can't have multiple processes reading from the same mailbox without writing your own message broker process to implement a multi-reader mailbox.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by acconsta on Wednesday September 16, 2015 @12:08PM (#10227620)
>I feel the language choice is probably the least contributing factor in terms of what's interesting at that scale

Erlang and BEAM were designed for highly concurrent messaging applications. Surely that's of some importance.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by sidcool on Wednesday September 16, 2015 @08:59AM (#10226191)
I agree, Wired didn't cover the subject with the kind of detail programmers would expect.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by forgetsusername on Wednesday September 16, 2015 @11:39AM (#10227404)
>with the kind of detail programmers would expect.

Wired isn't writing articles for programmers. It's a pop-science magazine writing tech articles for the mainstream.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by JupiterMoon on Wednesday September 16, 2015 @08:03AM (#10225945)
I think the point is more that WhatsApp continues to do one thing and to do it well. Conceptually this is simple -- although yes the scale adds plenty of complexity. Other social type services/apps/whatever try to become all things to all people they therefore become complex conceptually as well as due to scale.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by hellbanner on Wednesday September 16, 2015 @10:55AM (#10227045)
Well, they do more than just "one thing" like text-messaging. They support voice chat, location sharing, group messaging, games (I read that the Threes game is a WhatsApp game in Eastern Asia) -- lots of features.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by snake117 on Wednesday September 16, 2015 @09:51AM (#10226555)
I like the "startup feel" that WhatsApp retained; hire few people that can solve immediate problems and roll out necessary features. This alone takes a great deal of work, but admittedly much more manageable because you don't have to deal with unnecessary features that could potentially hinder your customers experience.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by nilkn on Wednesday September 16, 2015 @12:05PM (#10227589)
Isn't the fact that they've actually done it with so few people fairly concrete evidence that it's not incredibly complex?
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by digitalzombie on Wednesday September 16, 2015 @12:49PM (#10227966)
That's not evidence that's speculation.

They could be using really good tools. Or each of those 50 programmers are 10x more productive than regular programmer (I don't believe in this imo).

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by nilkn on Wednesday September 16, 2015 @03:42PM (#10229267)
The evidence in this case is the fact that they built the company and product with 50 developers.

Whether that evidence implies anything about the product's complexity is the speculative part.

If the explanation is that every single programmer at WhatsApp is 10x more productive than programmers at similar top companies, then my first question is how did WhatsApp manage to hire such people but Google, Facebook, etc., did not?

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by jasonwatkinspdx on Wednesday September 16, 2015 @05:00PM (#10229829)
Would you rather be one of 25,000 engineers at google, or one of 50 at whatsapp? A ton of people would chose the latter just to be in a more important core role. And if we use the acquisition price as a proxy for current market value, the per engineer capita is 20 times better at WhatsApp. I don't have any inside info, but I'm betting any of those engineers that had options are very very happy with their current job.
Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by nilkn on Wednesday September 16, 2015 @05:51PM (#10230149)
That's very handwavy and not rigorous.

> A ton of people would chose the latter just to be in a more important core role.

Yeah, and a ton of people would choose the former just to be in a bigger company with more perks or because they want to work on something other than an IM app.

Who knows? This isn't nearly strong enough to form a conclusion either way.

> the per engineer capita is 20 times better at WhatsApp

Perhaps, but why? You can't say that they got better talent just because they were a startup, because then I can point out all the other startups that don't have such talent.

> I'm betting any of those engineers that had options are very very happy with their current job.

I'm sure they are. I'm also sure they're not oracles who can predict the future. So they couldn't have known when joining that WhatsApp would be acquired for such a spectacular amount. So why WhatsApp over all the other startups? What did WhatsApp do to attract such world-class talent? I'm looking for a real, concrete answer that couldn't equally be applied to every other startup out there.

The alternative explanation, of course, is that WhatsApp just isn't as complex as some here are proposing it to be. Then we don't have the mystery of how they beat every other company in the world at hiring the greatest unknown talent. Rather, they simply timed the market perfectly, probably partially through luck.

Re:Why WhatsApp Only Needs 50 Engineers for Its 900M Users by ianstallings on Wednesday September 16, 2015 @11:52AM (#10227502)
In fairness, a lot of us have built systems that are just as complex, if not more. This is par for the course these days. The article seems to imply that they're doing something special, and that Erlang has something to do with it. It's no surprise to me that people are skeptical of such claims.