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 102 of Thinking Elixir, Sean Moriarity, the author of Genetic Algorithms in Elixir, lays out Machine Learning in the Elixir sp...
New
wolf4earth
Charles Max Wood takes the lead this week. He and Adi Iyengar discuss what Top End Devs are and what people should be doing to become Top...
New
brainlid
Episode 121 of Thinking Elixir. She started at the very beginning of her self-directed, non-traditional route to coding. She first had to...
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
brainlid
In episode 89 of Thinking Elixir, we talk about how designing applications with lower friction points is a valuable goal. LiveView plays ...
New
brainlid
In episode 72 of Thinking Elixir, we talk with Wiebe-Marten Wijnja about his project TypeCheck that provides a new kind of runtime type c...
New
brainlid
Episode 111 of Thinking Elixir. Ever wanted to deploy a PR for show-and-tell, QA testing, or to get feedback on it? Jason Axelson joins u...
New
brainlid
In episode 65 of Thinking Elixir, we talk with Elixir Core Team Member Aleksei Magusev about how he got involved in Elixir, what it’s lik...
New
brainlid
We go deeper on the Sobelow library, a security-focused static analysis tool for Elixir and Phoenix apps. We talk with Griffin Byatt, the...
New
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement