Well #FediHire, I'm on the market again! 25 year #Ruby / #Rails (and more!) powerhouse looking for employment. Reached 3rd highest contributor at my last gig despite 200k+ commits, 15+ years, and hundreds of developers. Have ~100 gems w/ ~2 billion downloads. You know me.
Loves: languages / runtimes, profiling & optimization, debugging, testing, OSS, etc.
https://www.zenspider.com/ryan/Resume.html
please #boost ❤️
RailsConf 2024 Video Update 🎥
We're thrilled to share our amazing recap video! 🙌 Thanks to everyone who participated and to Cindy and the @confreaks team.
Full videos coming next week! 🎉
Stay tuned, and in the meantime enjoy this look back at the incredible #RailsConf2024 experience: https://www.youtube.com/watch?v=f4SGZsrFLSI
For more fun, don't miss @rubyconf 2024 - join our list to get presale tickets now: https://rubyconf.org
@byroot We'd like to default to replicas for all reads, it reduces load on the writers. It's a little taxing to then have to wrap all write queries in a `connected_to` block though.
Perhaps we could write a customer resolver for this, we haven't decided. It could be nice though if you could configure AR to send writes to the correct database though.
@byroot If we moved that up we were thinking of adding an AR configuration item that would allow for automatically switching to the write database for write queries.
The motivation is that we'd set the default role for an abstract model to be the reading role. e.g.
```
class Foo < ActiveRecord::Base
self.abstract_class = true
self.default_role = ActiveRecord.reading_role
end
```
Then if you had a model Bar, that inherited from Foo, then `Bar.first` would default to the replica database.
@byroot I was hoping to get your thoughts on something, if you don't mind. At Zendesk we're thinking of opening a PR to refactor some ActiveRecord code you've been working on recently.
What we'd like to do:
- Perhaps move `#check_if_write_query` to be called earlier in the execution stack. Right now that method gets called in multiple places. It could _potentially_ simplify things if it was abstracted somewhere above (#internal_exec_query, #exec_insert, etc).