-
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 … -
How to deploy a Hatchbox app
I personally have used (and loved) Hatchbox for years. Hatchbox is essentially an “Ops-as-a-Service”. You bring your own server, whether a DigitalOcean droplet or a Hetzner VPS or something else, and their platform will configure the server, deploy the repo, and generally take care of going from “I don’t have an app on the internet” to “I do have an app on the internet”. Let’s walk through, step by step, how to deploy a Rails app to production with Hatchbox.
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
. -
Improving concurrency
Two months ago I released the
Continue reading …activerecord-enhancedsqlite3-adapter
gem, which adds a number of enhancements to theSQLite3Adapter
for ActiveRecord. Today I am releasing version 0.4.0 of the gem, which allows your Rails application to work in Puma’s clustered mode with multiple workers without getting those dreaded database deadlock errors. -
Improving the enhanced SQLite3 adapter
Two months ago I released the
Continue reading …activerecord-enhancedsqlite3-adapter
gem, which adds a number of enhancements to theSQLite3Adapter
for ActiveRecord. Today I am releasing version 0.3.0 of the gem, which adds an improved implemenation to handletimeout
s. -
Linear writes don't scale
One of the biggest myths around running SQLite in production for web applications is that it simply won’t scale beyond “toy/hobby” numbers, primarily because SQLite requires linear writes (that is, it doesn’t support concurrent writes). This isn’t true. Let’s dig into why.
Continue reading … -
Table Schema and Metadata
How can we get all of the information about a particular table in a SQLite database? The information is spread across several different sources, in various structures, and not so easy to collect into a single report. This post will show you how to get all of the information you need.
Continue reading …