4 ms·
DDL ends a transaction in MySQL. In my opinion, this is a showstopper and deal breaker. Good luck failing a migration in production.
by serpix 3y ago
DDL ends a transaction in MySQL. In my opinion, this is a showstopper and deal breaker. Good luck failing a migration in production.
- jonatron 3y agoDo people still use pt-online-schema-change for production schema changes? I remember using it a long time ago.
- ericbarrett 3y agoGh-ost is the new hotness. Simple to use and lots of great features: https://github.com/github/gh-ost https://github.com/github/gh-ost
- brianwawok 3y agoDjango just does it, run those migrations all the way through dev -> test -> prod. Look ma, no DBA required.
- daneel_w 3y agoUnfortunately yes, but as always only for the type of time-consuming DDL changes that incur a write block in a situation where you just can't have the production environment stall or wait that long. The past 5-10 years have seen several improvements allowing some types of schema changes to be done "online" without blocking writes.
- tonyarkles 3y agoA little history, I used: - MySQL from about 1999-2007 - Postgres from 2006-present - Oracle at a job 4 years ago One of the things that absolutely made my brain explode is that Oracle, too, does not support DDL transactions. I discovered this during a pretty funny code review. “Why are you wrapping this DDL in a transaction? That’s pointless.” “Wait… Oracle doesn’t support DDL transactions?” “What do you mean ‘DDL transactions’? That’s… should you be working on DB code at all?” “Wait… you mean if a migration in Oracle fails half way through it just… leaves things half broken? Let me show you what this would look like in Postgres” “WHAT THATS AMAZING!!!”
- golergka 3y agoYour reviewer immediately made a suggestion that you're just unqualified? Well, I shouldn't be so surprised, it's a company that chose to use Oracle after all...
- tonyarkles 3y agoAhhhh, it was much more polite than that and it was a junior-ish developer. I was new to the team and had already made it clear that while I had some database experience I had zero Oracle experience. I don't fault them too much; when someone suggests something that is completely outside of my mental model of how things work, it takes me a bit of reminding that I need to dig a little deeper to figure out what's going on and not just start jumping to conclusions about competence. It just happened to be a great opportunity for both of us to expand our mental model of how different systems work. If you imagine someone whose mental model is "DML commands can be transactional, DDL modifies the database structure directly" then it's pretty reasonable for them to go "Uh... this guy doesn't seem to know the difference between modifying data and modifying tables..."