Concurrent user updating stock with php
Erlang is made to allow phone switch system to run continuously and supports hotswapping: software updates while the software is running. On most other platforms handling more than ten thousand concurrent connections on one machine is seen as challenging, but Whatsapp have individual servers with more than 2 million concurrent connections.2 million connections on a single server, handled by Erlang. Millions of users play multiplayer games with game server infrastructure handled by Erlang for titles such as Call of Duty and Game of War.The Erlang syntax looks a bit strange if you are used to looking at languages such as C, Java, Java Script, PHP, Ruby, Perl etc.And things like package management, build tools, meta-programming, unicode handling and web frameworks are not as straight forward as in languages such as Ruby. Elixir creator José Valim said: “I liked everything I saw in Erlang, but I hated the things that I didn’t see”. The difference between Erlang and Elixir is not just the syntax.It was made at Ericsson in the 1980s to allow for better development of telephony applications.If you use 4G data on your phone it is more likely than not that the data is going through equipment from Ericsson. Have you ever thought about how phone operators do not disconnect everyone’s phone calls in order to apply software updates?Elixir has its own package management system, macros, an easy to use build tool and unicode handling. So it has all of the benefits of the mature, battle proven system and you can use the existing Erlang libraries with no performance penalty. But syntax does matter, and especially for Ruby developers the Elixir syntax will be very familiar. After having worked with immutable data for a while, I have realized how beneficial it is. To mention a few: The trend in hardware is more and more CPU cores.Even for single threaded programming, mutability brings an uncertainty about how a program will execute. Functional programming and immutability helps to clarify things and makes it easier to reason about code. The CPU manufacturers are not going to improve single core performance at the same rate as before. Also the world is concurrent and you do not want end users or other software services to needlessly wait for a response because your single threaded software is busy. Not only is it dangerous and hard to do synchronization.
While there is no desire to simply recreate Rails in Elixir, it means that Phoenix is also relatively easy to get started with because Rails has set certain minimum standards in that regard.
The Erlang platform has many advantages for serving reliable, scalable internet applications, it has a proven track record and has been around for decades.
So why is it not a more popular choice for web development?
Note that Erlang/Elixir processes are not native processes, they are much more light weight and are scheduled by the Erlang BEAM virtual machine.
Phoenix is the most popular web framework for Elixir right now.