pg-osc
departure
pg-osc | departure | |
---|---|---|
7 | 1 | |
486 | 134 | |
- | 0.0% | |
7.6 | 8.0 | |
about 1 month ago | 3 months ago | |
Ruby | Ruby | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pg-osc
-
How not to change PostgreSQL column type
My thoughts exactly. It's surprising that external online schema change tools for Postgres have only become a thing fairly recently! The only two I'm aware of are:
* pgroll: Written in Golang, first commits June 2023. https://github.com/xataio/pgroll
* pg-osc: Written in Ruby, first commits Dec 2021. https://github.com/shayonj/pg-osc
Meanwhile over in the MySQL and MariaDB ecosystem, external OSC tools have been around for quite some time, starting with oak-online-alter-table over 15 years ago. The most popular options today are pt-online-schema-change or gh-ost, but other battle-tested solutions include fb-osc, LHM, and the latest entry Spirit.
-
Pgroll: zero-downtime, undoable, schema migrations for Postgres
Great to see more innovation in this space! How does this compare to?
https://github.com/shayonj/pg-osc
- Want to avoid MySQL but find PlanetScale really appealing
-
Changing Tires at 100mph: A Guide to Zero Downtime Migrations
Postgres has some less robust tooling, at least both of these carry the "experimental" tag:
https://news.ycombinator.com/item?id=29825520
https://github.com/shayonj/pg-osc
But, still, they do it for you.
- Alter PostgreSQL tables without locks and downtime
-
pg-osc: Zero downtime non blocking schema changes in PostgreSQL
You can also try it out, Github: https://github.com/shayonj/pg-osc
-
Show HN: Zero-downtime PostgreSQL migrations for Ruby on Rails
This is very cool! I no longer work on Rails on daily basis, but would have loved to have this.
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.
departure
-
Changing Tires at 100mph: A Guide to Zero Downtime Migrations
At least for Rails there are several gems available (ie https://github.com/WeTransfer/ghost_adapter or https://github.com/departurerb/departure) that seamlessly hook into the existing migration system and will run all eligible migrations through gh-ost or pt-osc as needed. You're right that it's not free but it isn't all that far off either.
That said, online schema migrations are a specialized tool designed for very big tables that take hours to run an ALTER TABLE on. If all your tables are small enough that alterations take less than a second or so, don't bother and just block the table for a bit. It's fine.
What are some alternatives?
pg-online-schema-change - Easy CLI tool for making zero downtime schema changes and backfills in PostgreSQL [Moved to: https://github.com/shayonj/pg-osc]
reshape - An easy-to-use, zero-downtime schema migration tool for Postgres
safe-pg-migrations - Make your PostgreSQL migrations safe
data-migrate - Migrate and update data alongside your database structure.
ghost_adapter - Run ActiveRecord migrations through gh-ost
django-pg-zero-downtime-migrations - Django postgresql backend that apply migrations with respect to database locks
janet - A dynamic language and bytecode vm
tusker - PostgreSQL migration management tool
litestream - Streaming replication for SQLite.
pgroll - PostgreSQL zero-downtime migrations made easy
gh-ost - GitHub's Online Schema-migration Tool for MySQL