Re-graphing The Mental Model of The Rails Router
summary
A concrete claim: the Rails router is implemented as a graph engine (Journey) that tokenizes URLs with a scanner, parses them into syntax trees, then composes those trees into a generalized transition graph (a nondeterministic finite automaton) to match routes in sublinear time. The talk runs through the surprisingly large 123 slides of examples, shows the built-in rails.application.routes.router.visualizer, and demonstrates the visualizer working as a practical debugging tool that exposes the NFA and explains no route matches.
AI-written summary · about
chapters (11)
- 0:00Intro
- 5:54Investigating the Router
- 12:10Comparing to the Post Office
- 14:38Journey in the Router
- 20:28How Router Reads
- 22:10Tokenization
- 24:24Parser
- 25:11Syntax Trees
- 27:21Journey
- 31:15Two Outcomes
- 34:33Conclusion








