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 74 of Thinking Elixir, we talk with mother and daughter team Miki and Kate Rezentes about their experiences learning and worki...
New
brainlid
In episode 105 of Thinking Elixir, we learn about Plausible Analytics, a privacy respecting alternative to Google Analytics that is cloud...
New
ancatrusca
New BEAM There, Done That episode worth a read for anyone who’s had to defend an Elixir choice against teams pushing for Go, Rust, or Nod...
New
brainlid
In episode 71 of Thinking Elixir, we catch up with German Velasco then talk about the 7-GUI Tasks online challenge and how he wanted to s...
New
brainlid
In episode 92 of Thinking Elixir, we talk with Mitchell Hanberg and learn about why he created the alternate Phoenix templating language ...
New
bbense
Well, the only elixir specific thing about this is the site is written in Phoenix, but an important podcast for all open source advocates.
New
wolf4earth
Ben Moss joins the Mix to discuss Event Sourcing and CQRS in Elixir. Event sourcing is the practice of logging data across logged series ...
New
brainlid
In episode 84 of Thinking Elixir, we talk with Chris McCord about the LiveBeats project he created. It’s a high-quality, showcase, open s...
New
brainlid
In episode 90 of Thinking Elixir, we talk with Tetiana Dushenkivska, the creator of Elixir Cards, a series of Elixir flashcards with mult...
New
brainlid
We talk with Peter Ullrich about his experience sending SMS messages from a Raspberry Pi Zero using Nerves. We cover what went well, what...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement