u/keyslemur

▲ 9 r/rails+1 crossposts

Ozymandias on Rails. Cartography of a Ruin

When everything is on fire, nothing is on fire. Where do you start when every problem seems intractable? By drawing a map.

baweaver.com
u/keyslemur — 3 days ago
▲ 18 r/rails+1 crossposts

Ozymandias on Rails. The Pedestal Inscription

Shelley wrote about a king whose monument outlived everything it was built on. I've spent 15 years inside Rails monoliths that did the same thing. This is the first post about what to do when you're standing in the ruins.

baweaver.com
u/keyslemur — 7 days ago
▲ 40 r/rails+1 crossposts

Rails: The Sharp Parts. A Polymorphic Type Is Not a Foreign Key

I don't like to bury ledes, so when people ask me about polymorphic relationships my answer is simply:

Don't.

baweaver.com
u/keyslemur — 10 days ago
▲ 14 r/ruby

Beyond Enumerable: Counting Distinct with HyperLogLog

What if, by trading 1% correctness, you could count billions of items all within kilobytes worth of space? Well that's HyperLogLog, and as a non-bit-enlightened Rubyist it was a trip figuring out how it worked and how to explain it.

baweaver.com
u/keyslemur — 20 days ago
▲ 19 r/rails+1 crossposts

Rails: The Sharp Parts. Queries, Read Models, and Batching

The problem with optimizing indexes is if you don't control every query, and another team goes and writes an unoptimal variant in their code. Much like callbacks and commands there's a lot of value in owning your code paths and only exposing clear, named actions against it rather than trusting consumers to behave responsibly.

Eventually you hire folks who don't know Rails, might not read the guides, and that stuff compounds fast until outages start hitting. Soft rules are prayers at best, hard rules keep the line.

baweaver.com
u/keyslemur — 21 days ago
▲ 42 r/rails+1 crossposts

Rails: The Sharp Parts. Callbacks Are Not Invariants

The sheer number of outages I can point to across now 5 Rails monoliths related to issues with callbacks has made it one of the first things I go after when in a new Rails app to see what's about to give me a nightmare.

baweaver.com
u/keyslemur — 22 days ago
▲ 44 r/rails+1 crossposts

Rails: The Sharp Parts. An Index Is Not a Plan

Another one that took me a while to research and test, as I wanted to make sure I had a reasonable understanding of the subject matter, especially considering how often getting it wrong has given me a rather bad day.

baweaver.com
u/keyslemur — 23 days ago
▲ 16 r/ruby

Beyond Enumerable: Streaming and External Sort

Last one on this series for a bit, jumping back to some Rails and MySQL fun after this. The next parts of this series are venturing into probabilistic algorithms like HyperLogLog and boy howdy is that dense to get through.

baweaver.com
u/keyslemur — 25 days ago
▲ 15 r/ruby

Beyond Enumerable: Graphs and Traversal

This one is admittedly a sore spot considering how many interviews I've managed to fail over the years from not knowing a lot of this cold, so as is my penance I'm writing about this one too.

baweaver.com
u/keyslemur — 27 days ago
▲ 17 r/ruby

Beyond Enumerable: Heaps and Priority Queues

Honestly I never really understood how these were written and what the reasoning behind them was as much as I just reached for existing gems or frameworks, so as I tend to do I learn by teaching and writing.

baweaver.com
u/keyslemur — 28 days ago
▲ 33 r/rails+1 crossposts

Rails: The Sharp Parts. lock Is Not a Mutex

After trying to explain some of the sharp parts around locks to someone I realized I didn't know as much as I'd like to be able to answer with confidence on what to watch out for, so I spent a week or two looking into locking to pull this together.

baweaver.com
u/keyslemur — 1 month ago
▲ 9 r/ruby

Beyond Enumerable: For Want of Better Windows

I was working on some content for algorithms and maths, but in doing so I think I found a more generic starting place on some things that I feel may be missing from Enumerable and the thought experiments around them. This one starts with two-pointers and windows as a concept.

baweaver.com
u/keyslemur — 1 month ago
▲ 12 r/ruby

AI Didn't Create These Problems. It Just Stopped Routing Around Them.

Finally back to writing again, it's been a bit. Wanted to have a redesigned site first, and over the weekend I finally got that landed, so here we go.

baweaver.com
u/keyslemur — 1 month ago