brainlid

brainlid

Podcast: Thinking Elixir 158 - From Ruby to Elixir with Steve Bussey

Episode 158 of Thinking Elixir. A challenge for many people learning Elixir is the change in the mental model. Coming from OOP to Functional changes how we reason about our applications and the old way doesn’t always map over cleanly. Also, Elixir is capable of doing a lot more than other languages and frameworks can and this means learning how to build a “normal” application may change. We talk with @sb8244 about his new book “From Ruby to Elixir” that aims to help people bridge that gap. While the title says “Ruby”, we discuss how many of the concepts apply to people coming from most OOP languages. We talk about different libraries to recommend to people coming from a traditional Rails stack and more!

Most Liked

bottlenecked

bottlenecked

Hey, thanks for keeping at it - I’m looking forward to new episodes every week and it can’t be easy to fit podcast production in anyone’s schedule and be consistent at producing it - well done!

So as I’ve listened to this episode at some point @sb8244 mentions he’s not convinced that scheduling jobs on Postgres can ever be as fast as doing it with Redis - and thus it won’t scale unless coupled with some real Postgres expertise.

How I’m thinking about this is first of all, for high traffic job scheduling one would need to have a deeper understanding of any of their subsystems - be that Postgres, Redis or something more exotic backing the queue. So my question is why is Redis expertise any easier to come up with than Postgres expertise? I’ve not worked with any Redis gurus in the past, but I’ve definitely seen some database ones.

Second, I feel like the time needed to execute the job should almost always be dwarfing the time needed to enqueue / dequeue the job. For example if most of the jobs are about sending emails, then sending those and retrying in the face of errors should most definitely require more time than inserting / updating a record in the database. So I don’t see why the faster enqueuing / dequeuing of jobs from Redis (if this claim is even accurate or if the difference is meaningful if it exists) would scale better, as it’s not the act of dequeuing that takes time but rather that of executing the job. It feels like one would be limited by their app server’s resources much earlier than by their Postgres/Redis server’s resources.

Lastly, the usual arguments for keeping one’s setup as simple as possible should apply here as well: If a website is already using a database, why complicate the setup by bringing in Redis too? Will the benefits of Redis make up for the complexities arising from managing additional infrastructure on production?

Anyway, not meant as an offense to Steve or anything (all the love for discussing your new book!) - just interested in digging deeper on people’s experiences on that front.

sb8244

sb8244

Author of Real-Time Phoenix

I believe it is significantly easier to run Redis than postgres—there’s just less moving parts. I’d say potentially an order of magnitude less complexity.

My experience comes from a fairly high throughput environment where even with strong postgres operational experience we hit walls with it. We ran Redis for multiple years with maybe 1 operational incident (self inflicted).

If we ran a postgres job queue on the same database as our main app—there’s a 0% chance it would’ve been viable. This gets amplified if you have 100+ worker pods executing 20-50 parallel jobs in parallel.

All of this said: I’d still recommend Oban 9/10 times despite this. I’m not sure the scale we were running at is typical and so I wouldn’t make recommendations solely on an outlier experience.

In the episode I brought it up as a potential gotcha with postgres backed systems and I’ll probably always maintain that position. That disclaimer doesn’t mean you shouldn’t use it and it certainly didn’t mean I’m advocating for Redis job system. If I were then I wouldn’t be shy about it and I’d be including it in the book.

Where Next?

Popular in Podcasts Top

brainlid
In episode 105 of Thinking Elixir, we learn about Plausible Analytics, a privacy respecting alternative to Google Analytics that is cloud...
New
brainlid
Rust is a popular lower level language and the community has created a number of libraries to solve different problems. We talk with Jaso...
New
brainlid
In episode 67 of Thinking Elixir, we talk about ways we can all contribute to building a healthy Elixir community. The Elixir community i...
New
wolf4earth
David Yamnitsky joins the mix to discuss tangram.dev and how to use it to add Machine Learning features to your Elixir applications. He ...
New
brainlid
Episode 222 of Thinking Elixir. News includes the release of OTP 27.1 with significant improvements to the Zip module, the upcoming depre...
New
brainlid
In episode 106 of Thinking Elixir, we learn how the SonicPi project has been letting people live code musical performances for years. Sam...
New
brainlid
In episode 73 of Thinking Elixir, we talk with Paul Copplestone, founder and CEO of Supabase. Supabase leverages the power of Elixir, Pos...
New
brainlid
Some people excitedly talk about the “end of localhost development” when developer machines move to the cloud. Presumably this is better ...
New
brainlid
In episode 69 of Thinking Elixir, we talk with Dominic Letz about running Elixir on an Android phone in an APK which hosts a LiveView app...
New
ancatrusca
Task.async(fn → Rust.performant() end) Elixir :handshake: Rust What actually happens when BEAM resilience meets Rust performance? Flor...
New

Other popular topics Top

msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XXX...
New

We're in Beta

About us Mission Statement