Elixir in a "big" app ➔ Present & address concerns People have when considering Elixir for more "critical" projects ➔ Convince you it's great (& safe!) to use Elixir & Phoenix for big projects
- No - Because it is super fast? - No - Because we needed to scale to a billion users overnight? - No… if we scaled to a million we would be rich - Because we were spending a lot of money on machines? - No. We didn't even have a product! - Because we understood the Erlang platform, weighted its pros and cons and found out that it was the best fit for our needs? - No. Definitely No.
ecosystem related stuff? Will we need to build the world? - Will this whole thing turn into abandon-ware? - How productive is this framework? Should we be settling for something like Rails instead? - Will this be good for "complex" business logic? (which we do have lots) - Will this be stable in production? - (more particular to our case:) Will our hiring strategy work?
the beginning, we couldn't find good libraries to interact with Cassandra and ElasticSearch. - We ended up writing our own... - Today, we've got Xandra for Cassandra, but I don't know of any good alternative for ElasticSearch. Ping me if you do.
discovered that it is quite easy to get in a situation where a big chunk of the project is recompiled after changing just one file. - We suffered a lot, but got to understand the causes... - See http://milhouseonsoftware.com/2016/08/11/understanding-elixir-recompilation/ or my (unreleased) empex.co talk on this theme ~ demo ~
and we're on 3.1.24; - We started before `Date`, `NaiveDateTime` and `DateTime` even existed. - That hurt. And we had **lots** of complex logic depending on time… and we also kind-of misused timezones... - Thank you core team for `{Naive,}DateTime.diff/3`
unknown in the early days. - We had *lots* of trouble trying to mold releases into a "12 factor compliant" setup. Weird behaviours with environment variables... - We ended up running mix in production and we're doing exactly that until today. No problems since then :thumbs_up:
a single phoenix app. - As the app grew large, we felt the need to split it into an umbrella application. - As you guessed, we weren't very well modularized. - Lots of pain to get this done. (It was our fault)
- We got lazy and did not write much of unit tests as we were factoring out stuff from "fat controllers". Partially because things were too coupled, partially because of deadlines. - And that burned us. Bad. *Don't* ignore the testing pyramid. - In the beginning, everything was fine because the code in the controllers was concise and short. But that didn't last long.
to reimplement the frontend as an SPA. Consuming a graphql api. - Rewriting was *not* a good idea. (it rarely is…) - **LOTS** of problems with React, ClojureScript, GraphQL, reinventing HTTP, yadda yadda. - IMHO that was our biggest mistake problem. It was not Phoenix or Elixir related at all. I will come back to this latter.
We started prior to phoenix & ecto 1.0; Both have come a *long* way. - Stability! Phoenix & Elixir we're beyond stable. We even forgot to add `Restart=on-failure` on systemd! - Even though the app got *really* big, it was much simpler to work with than {Rails,Spring} apps of similar size we worked with before
popular libraries! (ecto, phoenix, erlcloud, plug, ja_serializer, timex, etc, etc) - We found a bug in the Elixir compiler! - We wrote some cool libraries! (like a stream-able zip encoder) - (and we also got some other stuff that we should be able to extract & open-source too)
ecosystem related stuff? Will we need to build the world? A lot before, a lot less today (always try not to!) - Will this become abandon-ware? Hell No! - How productive is this framework? Should I be settling for something like Rails instead? Phoenix is very productive! - Will this be good for "complex" business logic? Yep. No big issues - Will this be stable in production? As "stable" as "stable" can get. - (more particular to our case:) Will our hiring strategy work? It did.
Phoenix itself. - In 2015/2016 phoenix was enough to handle all our needs. Today it is even more so. Still lots of work to do, lots of opportunities to contribute. - Although Phoenix is new, it is *very well founded*. - The community *is* growing, the ecosystem *is* growing. Things are more and more *production ready & stable*.
estatement used to be very true: "you're trading maturity & productivity for performance". The amount of "maturity & productivity" we're trading is getting smaller and smaller. The future is bright. (and faster)