After reading two books, Programming Erlang (Joe Armstrong) and Programming Elixir (Dave Thomas), I have a few question about Erlang/Elixir in real world.
Q1: unifying backend development
I saw a table in a tech talk (I made a screenshot, but I forgot the source. If you know, please leave a comment):
+ ---------------------- + ------------------------- + --------- +
| Technical requirement | Server A | Server B |
+ ---------------------- + ------------------------- + --------- +
| HTTP Server | Nginx & Phusion | Elixir |
| Request Processing | Ruby on Rails | Elixir |
| Long Running Requests | Go | Elixir |
| Server-Side State | Redis | Elixir |
| Persistable Data | Redis & Mongo | Elixir |
| Background Jobs | Cron, Bash Scripts & Ruby | Elixir |
| Service Crash Recovery | Upstart | Elixir |
+ ---------------------- + ------------------------- + --------- +
Is that true? Is Erlang/Elixir so mature that it can handle all backend works?
If true, will this Erlang/Elixir code base be monolithic?
Q2: soft real-time
From Designing for Scalability with Erlang/OTP (Francesco Cesarini & Steve Vinoski):
If your system throughput is a million messages per second and a million simultaneous requests happen to be processed, it should take 1 second to process and deliver a request to its recipient. But if during a spike, two million requests are sent, there should be no degradation in the throughput; not some, but all of the requests should be handled within 2 seconds.
Can Erlang/Elixir really do that?
If my Erlang server (only on machine) can only handle 1M messages/sec and the request spike is 5M requests/sec, will almost all of the requests be handled within 5 seconds? How does Erlang work without a distributed environment? Why can't other backend tech do that (e.g. node.js)?
Q3: real-time scalability
Is there any available tech/tool/library/service or real case to scale up by adding Erlang nodes automatically when detecting request spikes, and scale down as soon as usage drops?
What are the tools suitable to manage deployment/monitoring/operation for Erlang/Elixir?
Q4: optimization
I know WhatsApp use Erlang to support their services. They did a lot of optimization on Erlang. Any info about this? If we need to optimize our Erlang services, how can we start it?