Stephen Margheim - SQLite on Rails: Supercharging the One-Person Framework - Rails World 2024

Learn how SQLite becomes production-ready in Rails 8 with improved defaults, discover its performance benefits, and understand when it's the right choice for your application.

Key takeaways
  • SQLite with Rails 8 becomes a viable production-ready database option with improved defaults and configurations

  • SQLite’s embedded architecture provides significant performance benefits - queries are measured in microseconds vs milliseconds due to elimination of network latency

  • Common concerns about SQLite’s production readiness (concurrent writes, scaling) are largely myths - it can handle databases up to 280TB and serve thousands of users effectively

  • SQLite works best for read-heavy applications (typical 80/20 read/write split) running on a single machine with vertical scaling

  • Rails 8 introduces production-ready defaults and improvements for SQLite, including better transaction management and connection handling

  • The simplicity of SQLite (single file + executable) reduces operational complexity compared to traditional client-server databases

  • Real-world examples like 37Signals’ Campfire demonstrate SQLite’s viability in production environments

  • Automated backup solutions and tools like Lightstream provide production-grade data resilience

  • The SQLite + Rails combination is particularly well-suited for one-person teams and bootstrapped applications

  • Trade-offs exist: linear writes require careful migration planning, and extremely write-heavy applications (50k+ writes/sec) may need alternative solutions