Diaspora is the crowd-funded open-source decentralized social network built on Rails. Full buzzword compliance: on by default. We have many thousands of active users and they generate a lot of social data. But after nine months of full-time development with MongoDB as our primary storage engine, a few months ago we converted it all to MySQL. Wait...what? Most people are going the other way, dropping Mongo into a project in place of MySQL or PostgreSQL. Plus, conventional wisdom says that social data is ill-suited to a traditional data store. Come hear a story about a large-scale Rails project that tried it both ways. You'll see crisis and redemption, facts and figures, nerds, kittens, ponycorns, and, of course, the secret sauce. Hecklers will be piped to /dev/null.
51. 2 When they say documents, they really mean
documents.
30
Photo from flickr user horrgakx, original: http://www.flickr.com/photos/horrgakx/2963449465
64. 34
Illustration from flickr user katy_tresedder, original: http://www.flickr.com/photos/katy_tresedder/4902794900
65. Y U SO HARD?
In General:
• Less documentation
• Lower googlability
• Smaller community
• Less gem support
• Team of developers with no Mongo experience
35
66. 36
Photo from flickr user nswmaritime, original: http://www.flickr.com/photos/nswmaritime/2963649924
67. 36
Photo from flickr user nswmaritime, original: http://www.flickr.com/photos/nswmaritime/2963649924
79. “Test‐driving” the migration
The Easy Way
1. Test‐drive conversion of a single sub‐
document from JSON to CSV
2. Test‐drive import of that CSV into AR
3. Run it on a copy of the production database*
44
80. “Test‐driving” the migration
The Easy Way
1. Test‐drive conversion of a single sub‐
document from JSON to CSV
2. Test‐drive import of that CSV into AR
3. Run it on a copy of the production database*
4. Add more test cases
44
81. “Test‐driving” the migration
The Easy Way
1. Test‐drive conversion of a single sub‐
document from JSON to CSV
2. Test‐drive import of that CSV into AR
3. Run it on a copy of the production database*
4. Add more test cases
44