-
Supercharge the One Person Framework with SQLite: Rails World 2024
Continue reading … -
Problems with a backoff busy handler
In the process of getting the non-blocking
Continue reading …busy_timeout
from thesqlite3
gem used in Rails, I needed to explore the differences between a busy handler implementation that uses a backoff and one that simply polls on a consistent interval. What I found was that a busy handler that backs off kills “tail latency” (how long it takes for the operation in the worst cases). This is because the SQLite “retry queue” behaves very differently from a more traditional queue that we tend to work with and think about, like a background job queue. -
The how and why of optimal performance
Continue reading … -
Isolated connection pools
If you want to squeeze as much performance out of your SQLite on Rails application, at some point you will need to confront the problem of writes saturating your connection pool. Let’s dig into this problem and how to solve it with some clever usage of Rails’ multi-database support.
Continue reading … -
Non-blocking timeout
Last month I released version 0.4.0 of the
Continue reading …activerecord-enhancedsqlite3-adapter
gem, which added support for a non-blockingbusy_timeout
to the SQLite adapter in Rails. As with all of my lower-level SQLite work, the goal is always to push these solutions into the foundations of the ecosystem so that everyone can benefit from them. In this case, I’m happy that thebusy_timeout
feature has made its way into thesqlite3
gem, which is the most popular SQLite gem for Ruby. -
SQLite Quick Tip: Multiple Databases
When building a full-featured Rails application, you will want not just a database to store your model data; you will want a job queue backend, a cache backend, maybe even a pubsub backend. When building a Rails app leveraging the power and simplicity of SQLite, you will likely wonder how best to architect these various services? 37signals has been releasing new gems to use solid-state storage via relational databases. They default to using one database to back all of these services, but they use MySQL. How should we handle this with SQLite?
Continue reading … -
Installing extensions
In a previous post, we discussed how to load SQLite extensions distributed as Ruby gems into a Ruby on Rails application. Unfortunately, there aren’t many SQLite extensions that are distributed as Ruby gems. So, in this post, we dig into how to install a wider range of SQLite extensions into our apps.
Continue reading … -
How (and why) to run SQLite in production: RubyConf Taiwan 2023
Continue reading … -
Prefixed ULID keys
I have written previously about using custom primary keys for your Rails app when using SQLite. In this post, I want to show how you can use the same
Continue reading …sqlite-ulid
extension to create prefixed ULIDs. Shout-out to Andy Stewart who suggested this. -
Introducing
litestream-ruby
I have already detailed why Litestream is essential for SQLite on Rails applications. But, as that original post makes clear, getting this utility setup and working in production requires some systems administration. Rails applications deserve better. Thus,
Continue reading …litestream-ruby
.