Topic hub · Ruby and Rails

Ruby and Rails investigations

Curated Ruby and Rails investigations on application design, performance, concurrency, databases, deployment, assets and maintainability.

About this collection

Ruby and Rails are treated here as working systems rather than collections of isolated idioms. The investigations follow objects across process boundaries, transactions, queues, HTTP streams, asset pipelines and database queries. Several begin with a small surprise: a job that ran before commit, an eager load that changed query behavior, a profiler report that implicated object shape rather than raw traffic, or a deployment layout whose simplicity hid shared infrastructure.

Read together, the notes show where framework conventions help and where the underlying Ruby, Unix, HTTP or PostgreSQL model still matters. The curated entries are useful starting points; the chronological list keeps the narrower experiments visible, including language design, Fibers, Ractors, C extensions and comparisons with other runtimes. This is a map of practical trade-offs, not a substitute for version-specific Rails documentation or measurement in the application being changed.

Start here

  1. The Rails job that ran before checkout committed Why a Rails background job can read old database state when checkout is still committing, how nested transactions hide the race, and how to fix it.
  2. Callbacks, invariants, and durable events in Rails Where Rails business rules can live, when callbacks are acceptable, and when state changes need durable event and delivery records.
  3. Using memory_profiler to reduce Rails memory pressure How to use memory_profiler as part of a broader Rails memory investigation: allocations, query shapes, object graphs, and practical fixes.
  4. Zero-allocation HTTP servers in Ruby terms Zero-allocation HTTP servers through Ruby examples: OxCaml's httpz experiment, span-based parsing, GC pressure, and pipelining.
  5. SICP ideas in practical Ruby How SICP design ideas appear in Ruby through blocks, higher-order methods, data barriers, streams, state, and small languages.

All investigations

  1. What the MacBook headphone jack knows about your headphones
  2. Finding 90% similar photos in a Photos library
  3. How Clojure complements Ruby
  4. Ruby and Rails hiring trends in Hacker News, 2019-2024
  5. APoSD and Clean Code from a Ruby point of view
  6. Callbacks, invariants, and durable events in Rails
  7. Rails includes, find, and eager loading
  8. SICP ideas in practical Ruby
  9. Supply-chain attacks, npm, Laravel, and Ruby teams
  10. PostgreSQL temp files and Rails pagination
  11. A Ruby AVIF conversion script with adaptive quality
  12. The Rails job that ran before checkout committed
  13. Brotli, gzip, and Propshaft in Rails
  14. Ruby, Go, Rust, and Zig for simple CLI apps
  15. Zero-allocation HTTP servers in Ruby terms
  16. Optimistic locking for editing a CRUD app
  17. Deploying multiple Rails apps on one VM with Capistrano
  18. Propshaft versus Sprockets in Rails assets
  19. Private and protected methods in Ruby
  20. SSE, proxy buffering, and long-polling fallbacks
  21. Service objects and Rails conventions
  22. Handling Server-Sent Events from a Rails backend
  23. SIMD string processing in a Ruby C extension
  24. Ruby Fibers and cooperative concurrency
  25. Relational algebra, SQL, and Arel
  26. Ruby, Lisp ideas, and Ripper S-expressions
  27. Rendering Hiccup-style HTML from JRuby
  28. Using memory_profiler to reduce Rails memory pressure
  29. Weighted full-text search and trigrams in PostgreSQL
  30. dRuby, Unix pipes, and forked worker pools
  31. Ruby performance archaeology: jemalloc and the bytecode cache
  32. Arel versus Sequel: an AST inside Rails and a toolkit outside it

Other hubs