Actor Model for instant messaging app?
Asked Answered
B

1

7

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.

Bureaucrat answered 24/4, 2018 at 16:48 Comment(4)
it is a good choice, but this question isn't a good fit for SOPetulia
@KeithNicholas why not? it is a broad concept. but stuff are not always true or false. dunno why people here insist on that. SO is just closing lots of good question just because of this idea.Bureaucrat
it's not about good or bad, there are many good questions that are not good for SO, often to the frustration of the question asker, but SO is really trying to be more like wikipedia with definitive answers to specific questions. It works well in that many many specific programming questions when googled will have SO answer at the top. It's just not so good for discussion / opinion based / overly broad questions as there is no definitive answer. Unfortunately there isn't a good place to refer people to go to get those kinds of questions answered.Petulia
yeah, but the thing is that definition of "question with definitive" answer by it self is broad. SO is not a place for discussion but it should be a place to share experiences (which might not be a one line or two line "definitive" answer") i am my self pretty much already know the answer to my question. i just need to know reasoning or experiences from other people in the field (which might differ from mine).we all <3 SO but it`s becoming Wikipedia of different ways to say "Hellow world!". which by definition has a definitive answer.Bureaucrat
H
4

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

Hoarfrost answered 26/4, 2018 at 3:46 Comment(3)
in you opinion, dose it make Actor Model a good choice for instant messaging apps?Bureaucrat
Considering Whatsapp, and from my understanding Facebook Messenger now use erlang, I'd say qualified people made that call.Hoarfrost
Also, RabbitMQ is an instant messenger written in Erlang )Hoarfrost

© 2022 - 2024 — McMap. All rights reserved.