Re:Reddit's database has only two tables
by DanielRibeiro on Sunday September 02, 2012 @10:52PM
(#4468944)
Alternatively, if using Active Record/Rails, you can use Large Hadron Migrator gem: http://backstage.soundcloud.com/2011/05/introducing-the-larg...
[ Parent
| on HN ]
Re:Reddit's database has only two tables
by DanielRibeiro on Monday September 03, 2012 @03:34AM
(#4469469)
In trying to undesrtand why such a negative reaction, soundcloud's take on this goes beyond just ruby or rails.
They detail an approach that goes extends tzs' suggestion:
1. Get the maximum primary key value for the table
2. Create new table and journal table
3. Activate journalling with triggers
4. Perform alter statement on new table
5. Copy in chunks up to max primary key value to new table
6. Switch new and original table names and remove triggers
7. Replay journal: insert, update, deletes
Not only did the have success with this approach, they studied Facebook's approach[1], and Twitter's[2], and explain why it didn't work for them.