Show HN: Zero-downtime PostgreSQL migrations for Ruby on Rails(github.com)
github.com
Show HN: Zero-downtime PostgreSQL migrations for Ruby on Rails
https://github.com/fatkodima/online_migrations
9 comments
This looks really cool, awesome job! We desperately need something like this at my day job, but unfortunately we use MySQL and Django.
While it hasn't been updated in a while, fundamentally https://github.com/pombredanne/django-zerodowntime would be a base for building similar check logic in a DB agnostic way on Django. It has some of the most important checks in place, but could obviously do with adding more sophisticated checks.
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.
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.
This is cool. We use strong_migrations but I’ll check this out. I love the idea of an enforced pattern for background data migrations.
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.
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.
We have something similar https://github.com/gocardless/nandi
It does signature checking and some and some other helpful things.
It does signature checking and some and some other helpful things.
Already existing gem works for both MySQL and PostgreSQL https://github.com/ankane/strong_migrations
Thanks for mentioning. I made a comparison with it - https://github.com/fatkodima/online_migrations#cool-but-ther...
Take a look at https://github.com/doctolib/safe-pg-migrations
Thanks for mentioning. Nice logo!
I have seen that and borrowed verbose sql logging. Nice gem, I see the differences.
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
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
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.