Vishnu Pedireddi
955 posts


@garrytan Swarm from four square - not sure if it’s an agent , but it does work good
English

@asmah2107 @houlihan_rick - the guy is a legend on the applications of databases
English

@asmah2107 The order created needs to be deleted in the catch block. Basically emulate what a transaction does on a rollback
English

@aviggiano @asmah2107 Or use percona tools to make the migrations
English

This is a classic problem in production database migrations at scale.
When you run ALTER TABLE ADD COLUMN phone_number VARCHAR(20) NOT NULL, the DB engine typically rewrites the entire table to add that column (especially in MySQL, Postgres pre-11, etc.). That’s what locks it.
The way to do a Painless Migration — avoid “stop-the-world”:
⸻
1️⃣ Add column as NULLABLE first (fast, no rewrite)
ALTER TABLE users ADD COLUMN phone_number VARCHAR(20) NULL;
This is instant in most engines — only updates the metadata (no locking the whole table).
⸻
2️⃣ Backfill data in small batches
You have 500M rows — do not update all at once!
Use a script that backfills phone_number with defaults or derived data, using small batches:
UPDATE users SET phone_number = 'UNKNOWN' WHERE phone_number IS NULL LIMIT 10000;
Run this repeatedly in a loop (cron job, job queue) — low load on DB, no locking.
⸻
3️⃣ Once backfill is 100% done — Add NOT NULL constraint
Now that no row has NULL anymore, you can do:
ALTER TABLE users ALTER COLUMN phone_number SET NOT NULL;
Again, in modern DBs this is usually instant, since no rewrite needed — just verifies constraint.
⸻
4️⃣ (Optional) Add indexes
If you need an index, add it concurrently:
CREATE INDEX CONCURRENTLY idx_users_phone_number ON users(phone_number);
⸻
Recap: zero downtime strategy
✅ Add column as NULL
✅ Backfill in small batches
✅ Set NOT NULL after backfill
✅ Add index concurrently
⸻
Why does this work?
✅ No full table lock
✅ No downtime for reads/writes
✅ Works on huge tables (500M+)
✅ App keeps working — can already use phone_number gradually
⸻
If you tell me what DB you’re using (MySQL? Postgres? Aurora?), I can tailor this more — each engine has its own quirks.
Would you like me to?
English

Quick question :
You need to add a new, required phone_number column to your users table, which has 500 million rows.
You write a simple ALTER TABLE script.
You run it during a "maintenance window."
It locks the entire users table for 8 hours while it adds the new column to every row.
For 8 hours, no one can sign up or log in.
Pain right ? You cannot perform "stop the world" operations on a live, large scale database
How will you do a “Painless Database Migration” ?
English

@DavidKPiano It’s not the rewrite that hard, it’s the expectations to not regress on deliverable that’s tech leads fear
English

@markgadala I’m waiting for the day AI can setup my development machine.
English

I am convinced we are doing AI coding wrong. Completely wrong in fact.
Humans need abstraction and code reuse to reduce costs and manage complexity.
That is not true for AIs however. They can just brute force things. No reuse and abstractions needed.
So instead of trying to coerce AIs to "structure" their code for our own benefit, we should just let them do the thing they do best, generate whatever code they want. As long as it works, we should be happy.
It is a bit like organizing your email in folders vs using search.
Embrace the chaos!

English

Indians move abroad to…
Eat overpriced butter chicken from a Punjabi with a fake Italian accent.
Buy haldi and hing that costs more than a bottle of wine.
Miss golgappas while chewing on sad quinoa.
Celebrate Diwali like it’s the Met Gala—minus celebs, plus aunties in Swarovski sarees.
Make only Indian friends and discuss how “things are better back home.”
Form a WhatsApp group called Desi Squad.
And then save up in dollars… just to fly back and tell their parents how amazing life is over there.
English

@vitrupo The faceplant these technologists are heading into will be epic
English

Amjad Masad says the nature of software, companies, and the economy changes when anyone can create and run AI agents.
You describe a product. The agent "grabs" a database, pays with its wallet, and deploys it.
Income flows through "ambient services" run by "people making money on the internet."
English
Vishnu Pedireddi retweetledi

This is a wonderful example of the competence journey. New solutions to existing problems are always judged by the expectations of the old ways. It's a struggle to break through those expectations! Many give up early. But the determined keep going and eventually get it 🤘
Javi@rameerez
I recommended Kamal to two different people this week alone, and they're not even Rails developers ~1.5mo after this tweet x.com/rameerez/statu…
English

Watching ruby on rails console do DB migrations and letting me play with records feels like advanced magic. Falling for RoR ! @dhh #RubyOnRails
English

@HumansNoContext Cloud hyperscalers providing the next AI product
English













