axelson

axelson

Scenic Core Team

8) ElixirConf 2017 - Phoenix after 100000 lines - Renan Ranelli

ElixirConf 2017 - Phoenix after 100000 lines - Renan Ranelli

Given phoenix’s rise in popularity, the internet is flooded with examples and “getting started” tutorials.

What happens when your phoenix app grows beyond the “trivial” examples we see in the wild? What are the good patterns you should adopt and what are the ones you should avoid?

In this talk I’m going to share the problems (and solutions!) we encountered while growing our 2+ year old phoenix app beyond 100,000 lines of code, while also migrating from server-side html to a full fledged SPA.

After this talk, the listener will be able to (hopefully) better access the trade-offs and impacts on using Phoenix for their next (hopefully big) project.

Audience: All

All talks are available in the Elixir Conf 2017 Talks List or via the elixirconf2017 tag

Most Liked

josevalim

josevalim

Creator of Elixir

I just finished the talk, I just want to clarify one more thing regarding the compilation. Renan mentioned that the Phoenix router takes a long time to compile but that’s likely not the case. The issue is that a lot of his application likely depends on the router and that holds everything else back. To some extent this is Phoenix’s fault since controllers and views import the router and that sets up a compile time dependency. I have pinged Renan to confirm this and opened up an issue on Phoenix’s issues tracker.

josevalim

josevalim

Creator of Elixir

I would say that’s fine. The real issue is that many modules have a compile time dependency on the router and that could be solved if we aliases the router helpers instead of importing them.

JEG2

JEG2

Author of Designing Elixir Systems with OTP

This was a pretty good description of real world Phoenix. I enjoy hearing what worked and didn’t for other groups.

wojtekmach

wojtekmach

Hex Core Team

Just wanted to add that It’s pretty easy to introduce a lot of module dependencies to the router via plugs, e.g.:

# router.ex
plug MyApp.CurrentUser

# current_user.ex
def call(conn, _) do
  Users.get(...)
end

this introduces a compile-time dependency between the Router and MyApp.CurrentUser
And then if the Users/User modules (or any of their runtime/compile dependencies) change the router will need to be recompiled and thus all controllers & views. Although it’s a hacky solution, having one Module.concat in critical place (e.g. the one plug that reaches out to schemas) can save a lot of recompilations.

Where Next?

Popular in Talks Top

ShalokShalom
So, there is another Erlang VM on the way :hugs:
New
AstonJ
Just starting to go up - here's the first three: By @lpil By @Crowdhailer By Evadne Wu (Why aren't you a member Evadne :p)
New
axelson
by @SophieDeBenedetto LiveView’s reliance on server-rendered HTML and leveraging of bi-directional communication over WebSockets means ...
New
axelson
Almost done with posting the Elixir Conf talks! ElixirConf 2017 - Realtime Vehicle Tracking with Elixir and Phoenix - @st23am ...
New
CodeSync
Code Sync: Celebrating the 10 Years of Elixir | José Valim | ElixirConf EU 2022 Comments welcome! View the #code-sync and #elixirconf-e...
New
brightball
Since the comments are turned off on the YouTube videos, I'm going to post on talk per day on here for viewing and discussion...starting ...
New
axelson
ElixirConf US 2018 – We’re Just Getting Started - Our Three Years with Elixir – Maciej Kaszubowski (@mkaszubowski) The s...
New
kokolegorille
Lonestar Elixir 2018 videos are starting to pop up :slight_smile: https://www.youtube.com/channel/UCOy-_b9bqjokoWX9Hg5ZgUg Day 1 Chris ...
New
New
axelson
by @jola Can you write a performant string processing scripts in Elixir? This talk attempts to answer that question while incrementally...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement