Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Actor Model for instant messaging app?

i have a background in enterprise distributed systems using Messaging technologies such as RabbitMQ and others, though i am relatively new to Actor Model.

with that said, i am wondering if it is a good idea to use the Actor Model frameworks such as AKKA or AKKA.NET for an application similar to Whatsapp? given the requirements of such apps (High availability, low latency etc...).

my other question is that, is the built-in actor model of Erlang the reason why big companies use it for their messaging apps or there is something else that i am not aware of?

technical explanation is highly appreciated. thanks in advance.

like image 904
SHM Avatar asked Oct 28 '22 13:10

SHM


1 Answers

I believe the actor model is one of the things that makes Erlang applications so fault tolerant.

Processes/Actors can die without affecting other processes or corrupting shared data as there is none. Erlang processes are also very cheap to spin up, so if you need a process or 10 for each client it is not a problem. Erlang uses supervision trees which can restart processes in several different strategies, such as one-for-all or one-for-one, so if a process fails it can restart all processes in that branch or just one process without touching the others. This is important when you have millions of clients in live voice/video/chat sessions.

Erlan also comes with built in concurrency and garbage collection. You spend much less time thinking about how to scale your project and how to keep it from crashing than you would in other languages. It is also faster to develop in than low level languages, thanks to pattern matching, OTP and Let It Crash mindset.

Sorry if it's not technical enough, maybe someone else can pitch in on that. If you want a good general overview of erlang check out these videos - https://www.cs.kent.ac.uk/ErlangMasterClasses/#class1

like image 118
Roman Rabinovich Avatar answered Nov 11 '22 06:11

Roman Rabinovich