| > You seem to be familiar with Elixir. May I ask you some questions? Sure, np. I am mainly an Erlang developer but the same properties apply to Elixir, because both share the same battle tested VM -- BEAM. > I'm asking what kind of web apps or scenarios do you think Elixir is particularly well suited for? I am not currently working on building web app directly. But in general Elixir/Erlang would be good for a scenario where they'd be multiple connected clients at the same time. Think maybe something like a car sharing service where map updates in realtime as cars move through the city. Lots of users chatting together, or playing a game. Maybe they are bidding on ads, or tagging posts with "likes" and so on. But there might be a significant improvemtent even in the plain old request-goes-to-database scenario, simply because the VM (BEAM) is better equipped at handling multiple connected sockets, all streaming data in and out. For example, it knows how to take advantage of multiple CPU cores, it handles GC better and so on. Not sure how deeply you want this explanation to go, so will stop here. But, yes, if it all goes to a single MySQL instance running in another datacenter, that might be the bottleneck so there might not be a speedup seen by using something else. So you have to measure. In that case maybe a cache in front of it will work just as well to speed things up. > he was doing away with the db completely. Haven't seen the video. But with Erlang can think of those processes as in-memory storage of state. Can spawn hundreds of thousands of them, and they can live as long as the node stays up. Then can also connect multiple BEAM VM instances on different machines, create a cluster and so can refer to these processes as if they are local, in a rather transparrent manner. Or maybe they mean they used Erlang's built-in database (Mnesia), that had some limitations, but recently in a new release (19.0) it has the ability to scale much better as it can handle a pluggable storage such as LevelDB for example. The advantage there is the database is integrated into the langauge. So queries are not in a different query language, via a driver, so some other process, but queries looks like list comprehensions and transactions are just function closures. That can simplify things immensly in some cases. > how do you architect your application in Elixir to keep application state though multiple requests (sessions) on multiple boxes without using something like memcached or redis (or a network disk)? Can create a cluster so can keep state on another node that doesn't go down? (as mentioned), or can still use a database (say Postgres), so it really depends. Hard to give a general advice here. |
Part of the problem I had with the videos had to do with the examples they were using (a shopping cart that stores data on process memory rather than an external db seems a little risky to me).
I will investigate Erlang Clusters. Again, thank you for your answer.