Show HN: Zero-downtime PostgreSQL migrations for Ruby on Rails
github.com
github.com
I built something similar called `pg-osc` / `pg-online-schema-change` for PostgreSQL workloads. It does zero downtime migrations using triggers and shadow table.
Github: https://github.com/shayonj/pg-osc.
Blog: https://www.shayon.dev/post/2022/47/pg-osc-zero-downtime-sch...
Also love that this is written in Ruby :). Going to check it out on some side projects.
For Django users using PostgreSQL you can use https://github.com/antonioIrizar/django-check-migration-wtf or https://github.com/yandex/zero-downtime-migrations or https://github.com/tbicr/django-pg-zero-downtime-migrations to provide similar functionality to the library this post links to, depending on your exact use case of course.
While I’m here a shameless plug for a gem we built that we’ve found incredibly helpful for safer migrations - https://github.com/TandaHQ/migration_signature
It adds a CI check to guarantee the migrations you tested in development are actually the migrations that run in production.
It does signature checking and some and some other helpful things.
My gem:
1. has more checks 2. has more migration helpers (renaming tables/columns, changing columns types, backfilling etc) 3. more flexible in terms of configuration 4. has background data migrations 5. does not disables wrapping migrations in a transaction, which can be inconvenient and dangerous