ruby-on-rails
ruby-on-rails
http-caching
HTTP caching for engineers who forgot the sharp edges
HTTP caching refresher for engineers: how freshness, revalidation, Vary and Cache-Control really interact, why stale responses can still be useful, what reload actually does, and the boring headers that keep private content out of shared caches.
ruby-on-rails
Rails view rendering performance: when render gets expensive
Rails partials feel free until a page renders hundreds of them. Benchmarks of five rendering strategies (inline ERB, partial loops, collection rendering and more) show which is fastest, why the helper trick backfires, and a practical rule for when to optimize views.
Latest
UUIDv7 from PostgreSQL 18 in practice
UUIDv7 arrives in PostgreSQL 18 as a built-in uuidv7() function. See what it changes in practice: friendlier indexes than UUIDv4, simpler Rails migrations, a schema example, and the security caveat that time-ordered does not mean secret.
How to audit a legacy Rails codebase without getting lost
Auditing a legacy Rails codebase starts with one question: what is the team afraid to change? A practical method for finding real hotspots, building a small audit ledger, using tools and AI without drowning in output, and delivering one page that people act on.
Getting structured input and output from Ollama
Structured output from Ollama takes more than JSON mode. Learn the reliable pattern for a Rails app: shape the input, constrain output with JSON Schema, parse defensively, and retry with feedback so a local LLM survives production instead of just a demo.
Be aware of possible problems with SQLite on Production
SQLite in production works better than its toy reputation, but only if you know the traps: why WAL mode is non-negotiable, how blue-green deployments break your setup, missing ILIKE, quirky JSON types, and what you honestly gain in return.
Structured logging in Rails 8.1 with Rails.event
Structured logging lands in Rails 8.1 with the Rails.event API. How the Structured Event Reporter replaces regex-parsed log lines with JSON events, plus tags, context, schemas, debug mode, and how to subscribe and test events in your own app.
When to use Module over Class in Ruby?
Ruby modules often beat classes for service objects: why a shell class like PasswordResetInitiator is procedural code in disguise, using a module as a toolbox, mixins instead of artificial inheritance, and Data objects for tidy parameters.
Ruby 4.0 - a big update for its 30th birthday
Ruby 4.0 marks the language's 30th birthday with maturity instead of revolution: saner syntax for multiline conditions, faster boot with fewer requires, a maturing Ractor story, hidden performance gems, and protection against command injection.
How to control queues and concurrency in Sidekiq?
Sidekiq capsules let you give each queue its own concurrency, so photo processing stops clogging urgent jobs and API calls stay under rate limits. A three-step setup: configure the capsule, assign the job, and call it, with configuration examples.
Rails Performance Optimisation - Understanding GVL in practice
Rails performance starts with understanding the GVL: why only one thread runs Ruby code at a time, how that throttles CPU-bound apps, throughput vs latency, choosing a server, offloading to background jobs, and how to instrument and measure before optimising.
PostgreSQL and lock timeout issues – how to deal with them also in Ruby on Rails?
PostgreSQL lock timeouts strike during long migrations and complex transactions. How lock_timeout and statement_timeout actually work, quick fixes at the database role level, managing timeouts in Rails migrations, and global protection with StrongMigrations.
How to add actions after saving in Rails models? A new approach...
after_all_transactions_commit solves a classic Rails race condition: a background job looking for a record that is not committed yet. How the new ActiveRecord callback works inside and outside transaction blocks, and when to reach for it.
How to track and log slow queries in Ruby on Rails applications?
Slow SQL queries in Rails can be caught in development, before they become production fires. Using ActiveSupport::Notifications and the sql.active_record event, you build a small performance guard that logs every query above a time threshold straight to your console.
How to effectively manage and terminate old PostgreSQL connections
Idle PostgreSQL connections eat memory and can hit the max_connections limit, blocking your app. How to find old sessions in pg_stat_activity, close them safely with pg_terminate_backend, and automate the cleanup so hanging connections never pile up again.
How can the AASM state machine be replaced with built-in Ruby on Rails methods?
AASM adds complexity most Rails apps don't need. How to replace the state machine gem with Rails 7.1+ enum, validations, and small service objects: a project management example with forms, translations, unit tests, multiple enums, and state history tracking.
Deprecation in Rails: How to gracefully remove old code
Deprecation lets you remove old Rails code without breaking teammates' apps overnight. A practical look at ActiveSupport::Deprecation: why sudden deletes hurt, how to warn about methods scheduled for removal, and how to phase out code in a civilized way.
How can large files be sent efficiently in Ruby on Rails with authentication and caching?
Sending large files through Rails wastes memory and blocks app workers. X-Sendfile hands the transfer to NGINX while Rails keeps authentication and caching: server configuration, cache headers, testing in development, other HTTP servers, and a complete example.
ActiveJob::Continuable - Interrupting and resuming jobs in Ruby on Rails
ActiveJob::Continuable lets long-running Rails jobs survive restarts: split work into steps, track progress with cursors and checkpoints, and resume exactly where the job stopped. Covers error handling, queue adapter support, and a practical example.
14 powerful Rails console tricks that will supercharge your debugging
Rails console tricks that speed up debugging: silence SQL logs, reuse the last result with underscore, inspect routes and schema, find where a method is defined, run rake tasks and raw SQL, time operations, and several more you probably haven't used yet.
How to create a custom rubocop rule to improve code quality?
Custom RuboCop cops let you enforce your project's own conventions. Step by step: how cops inspect the abstract syntax tree, writing a cop that bans hardcoded phone numbers, wiring it into your RuboCop config, and watching it flag offenses in action.
Transforming YAML config files into Ruby objects with helpers
YAML config files don't have to end up as messy nested hashes. Turn them into real Ruby objects with validation and custom methods: a small model class that loads the YAML, exposes clean accessors, and grows with your Rails app's configuration needs.