Generated by GPT-5-mini| Ruby on Rails | |
|---|---|
| Name | Ruby on Rails |
| Developer | David Heinemeier Hansson, 37signals |
| Released | 2004 |
| Programming language | Ruby (programming language) |
| Operating system | Unix-like; Windows NT; macOS |
| License | MIT License |
Ruby on Rails
Ruby on Rails is a server-side web application framework written in Ruby (programming language). It was created to accelerate web development by following convention-over-configuration and model–view–controller patterns, influencing projects in the ecosystems of GitHub, Basecamp, Shopify, Heroku and GitLab. The framework interplays with tools and platforms such as SQLite, PostgreSQL, MySQL, Amazon Web Services, and Docker to deliver full-stack web applications.
Ruby on Rails emerged in the early 2000s within the context of web development practices shaped by PHP, Java Servlet, ASP.NET, Django (web framework), and Perl. Its principal creator, David Heinemeier Hansson, extracted Rails from work on Basecamp at 37signals and released it publicly in 2004, joining a lineage of frameworks influenced by Model–view–controller architecture traditions originating with Smalltalk. Rails' adoption accelerated alongside the growth of Ruby (programming language) communities, the rise of hosted platforms like Heroku and repository services such as GitHub, and events like RailsConf and RubyConf which propagated conventions and ecosystem tooling.
Rails organizes applications with the model–view–controller pattern, drawing architectural parallels to MVC uses in Smalltalk, Struts, Spring Framework, and ASP.NET MVC. Core components include an active record implementation compatible with PostgreSQL, MySQL, and SQLite; a routing layer that maps URLs to controller actions akin to routing in Django (web framework) and Express.js; a view layer using embedded Ruby templates comparable to templating in Jinja2 and ERB; and an asset pipeline for managing JavaScript and CSS inspired by tools like Sprockets and later integrations with Webpack and Yarn. Background job processing integrates with systems such as Sidekiq, Resque, and Delayed::Job, while caching strategies parallel solutions used by Varnish, Redis, and Memcached.
Rails emphasizes "convention over configuration," a philosophy also visible in Spring Framework and Django (web framework), reducing boilerplate by adopting naming patterns for models, controllers, and database tables. It embeds RESTful design principles championed by Roy Fielding and supports scaffolding and generators resembling features in Yeoman and Scaffold systems. Internationalization follows patterns used by gettext-based projects, while testing conventions align with tools like RSpec, MiniTest, and continuous integration platforms such as Travis CI, CircleCI, and Jenkins.
Typical Rails development workflows combine version control with Git and hosting on GitHub or GitLab, continuous integration via Travis CI or CircleCI, and deployment to Heroku, Amazon Web Services, or Google Cloud Platform. Developers use editors and IDEs like Visual Studio Code, RubyMine, Sublime Text, and Vim. Dependency management relies on Bundler and the RubyGems ecosystem, while package management for front-end assets integrates NPM and Yarn. Monitoring, error tracking, and performance profiling often use services such as New Relic, Sentry, and Datadog.
Rails' performance has been discussed alongside platforms like Node.js, Go (programming language), Elixir (programming language), and Java-based frameworks. Scaling strategies commonly involve horizontal scaling across multiple dynos or instances on Heroku or AWS Elastic Beanstalk, read replicas in PostgreSQL clusters, background job offloading to Sidekiq backed by Redis, HTTP caching via Varnish or Cloudflare, and using CDNs like Akamai and Fastly. Architectural patterns such as service-oriented architectures exemplified by Microservices and event-driven designs like Apache Kafka are adopted to mitigate single-process constraints and enable high-throughput systems used by companies such as Shopify and GitHub.
Rails powered early high-profile web applications and services including Basecamp and later influenced platforms such as GitHub, Shopify, Airbnb, SoundCloud, Hulu, and Groupon. The framework contributed to rapid prototyping in startups showcased at Y Combinator and enterprise adoption by organizations like White House digital projects and Yellow Pages Group. Ecosystem contributions from companies like Heroku, Engine Yard, and ThoughtWorks extended deployment and consultancy support.
Criticisms of Rails include debates over runtime performance compared with Node.js and Go (programming language), memory footprint relative to Elixir (programming language) on the BEAM VM, and scaling cost concerns noted in analyses by Martin Fowler and platform engineering teams at Twitter and Facebook. Security issues documented in advisories have included cross-site scripting, SQL injection, and mass-assignment vulnerabilities; mitigations were implemented through parameter filtering, strong parameters, and security patches coordinated with the Open Web Application Security Project and advisories posted by CVE entries. Regular audits, dependency updates via Bundler, and use of static analysis tools like Brakeman are standard practices to reduce risk.
Category:Web frameworks