How to make a chat app like WhatsApp?

The learning curve with Erlang/Elixir typically goes through three distinct phases:

  • Sequential programming - the same type of “programming” you’d expect in Python or Ruby (only functional :smile:)
  • Concurrent programming - using the concurrency primitives spawn, send, receive to divide work into units (BEAM processes) that work together to get something done. But because of the emergence of the various edge cases that keep coming up that you don’t want to be dealing with again and again you move on to
  • Developing OTP applications. Basically you are using battle-tested code templates (behaviours) for BEAM processes to build your own applications. And OTP applications work together to solve a larger problem

Phoenix is an OTP application, Ecto is an OTP application and your code is an OTP application working together with them. Now the Phoenix team has arranged it that simple web-applications can be implemented just within Phoenix - but the primary recommendation is to keep your application separate from Phoenix in order to have the opportunity to grow.

Slides for: Erlang Factory SF March 30, 2012: Scaling to Millions of Simultaneous Connections

Youtube Video

8 Likes