Ruby on Rails backend API specialist with 8+ years building scalable REST and GraphQL APIs. Deep expertise in ActiveRecord optimization, background jobs, caching strategies, and production monitoring.
Production visibility requires more than basic request logging. I instrument critical code paths using ActiveSupport::Notifications to publish custom metrics that monitoring services consume. Each instrumented block publishes events with timing data,
ActiveJob provides a unified interface across different queue backends (Sidekiq, Resque, Delayed Job), making it easier to switch adapters or test jobs. I define jobs by inheriting from ApplicationJob and implementing perform. ActiveJob handles serial
Complex reporting queries with multiple joins and aggregations can become unmaintainable in ActiveRecord. PostgreSQL views encapsulate query complexity in the database layer and appear as regular tables to Rails. I create views for common reporting ne
Long-running requests tie up worker threads and degrade overall application responsiveness. Rack::Timeout enforces request timeouts at the Rack layer, killing requests that exceed configured limits. I set conservative timeouts (15-30 seconds) and hand
While JWT works well for user authentication, service-to-service communication often uses simpler API key authentication. I generate cryptographically random API keys using SecureRandom.hex(32) and store them hashed in the database, similar to passwor
Understanding query execution plans is essential for optimizing slow queries. Rails provides explain method on ActiveRecord relations to show PostgreSQL's query planner output. I look for sequential scans on large tables (indicating missing indexes),