Cellane

Cellane

Been asked to do a presentation about Elixir - what should I include?

I’ve been asked by my supervisors at work to finally give everyone in the team presentation about “that Elixir thing you can’t seem to shut up about” (:rofl:) so I’m busy preparing slides that would hopefully present a good pitch as to why FP and Elixir is a good idea. I’d be happy to hear about past talks and presentations from other people that I could use as inspiration!

Most Liked

dimitarvp

dimitarvp

Make VERY SURE to outline the runtime’s benefits:

  • Preemptive scheduling (what 99% of the runtimes out there don’t have)
  • OTP’s let it crash and get restored way of work
  • Supervisors!
  • Extremely easy to achieve parallelism and concurrency

Most people just fangirl at the language and a lot of other people are very rightfully not impressed. This decision is only 5-10% about the languages (say because of meta-programming / macros and good libraries). 90-95% of the benefit is the runtime so do your very best to highlight that!

dimitarvp

dimitarvp

Preemptive scheduling

Not one single OTP Process (what in other programming languages are called actors, green threads, fibers) can affect the latency of the others. The average execution time of any given function should remain mostly the same even under heavy load – a huge selling point IMO. That’s why Phoenix apps on $5 worth of servers can handle 2000+ requests a second (while a Ruby on Rails or Laravel vanilla app can be brought to its knees by 100-200 requests a second).

Parallelism / concurrency

Consider this:

def send_email_batch(list_of_emails) do
  # This will receive no more than 100 email addresses
  YourMailSender.send_batch_message(list_of_emails)
end

list_of_emails # Supposedly a very big list
|> Stream.chunk(100)
|> Task.async_stream(&send_email_batch/1, timeout: :infinity, max_concurrency: 20)
|> Stream.run()

:point_up: This will get a big list of emails, break the list into smaller lists of 100 emails each and send each chunk (batch) in parallel, but it never sends more than 20 batches at the same time (the :max_concurrency option of Task.async_stream), e.g. at any given time maximum of 2000 emails are being sent (if we assume this is your email sending provider’s API rate limit and that you want to comply with it).

This extremely transparent parallelism / concurrency is what brought me to Elixir.

AstonJ

AstonJ

Some great thoughts by Dimi and you might also find what Robert wrote in the Erlang Rationale worth a look :smiley:

These EF threads might also contain something of use?

:nerd_face:

Good luck and let us know how you get on :+1:

Popular Backend topics Top

PragmaticBookshelf
Stop developing web apps with yesterday’s tools. Today, developers are increasingly adopting Clojure as a web-development platform. See f...
New
PragmaticBookshelf
Elixir and OTP provide exceptional tools to build rock-solid back-end applications that scale. Build a web application in a radically dif...
New
PragmaticBookshelf
Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that u...
New
bot
Kotlin v1.4.0 has been released. Link: Release Kotlin 1.4.0 · JetBrains/kotlin · GitHub
New
DevotionGeo
How Dgraph was running out of memory for some users, and how Go’s Garbage collector wasn’t enough, and Dgraph team used jemalloc to manag...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
First poster: bot
Ruby on Rails v6.1.0 has been released. Link: Release 6.1.0 · rails/rails · GitHub
New
mafinar
Hello folks! We had a pretty fun thread here around the same time last year - talking about Advent of Code problems. That also happened t...
New
ManningBooks
Fully updated to Elixir 1.14, this authoritative bestseller reveals how Elixir tackles problems of scalability, fault tolerance, and high...
New
PragmaticBookshelf
Build fast, scalable PostgreSQL and Rails apps. Solve data growth, quality, and reliability challenges, for workloads from consumer Inter...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
New