Dhaval Tanna

1 result

Powering an online community of coders with MongoDB Atlas

This is a guest post by Linda Peng (creator of CodeBuddies) and Dhaval Tanna (core contributor). If you’re learning to code, or if you already have coding experience, it helps to have other people around -- like mentors, coworkers, hackathon buddies and study partners -- to help accelerate your learning, especially when you get stuck. But not everyone can commute to a tech meetup, or lives in a city with access to a network of study partners or mentors/coworkers who can help them. CodeBuddies started in 2014 as a free virtual space for independent code learners to share knowledge and help each other learn. It is fully remote and 100% volunteer-driven, and helps those who — due to geography, schedule or personal responsibilities — might not be able to easily attend in-person tech meetups and workshops/hackathons where they could find study partners and mentors. The community is now comprised of a mix of experienced software engineers and beginning coders from countries around the world, who share advice and knowledge in a friendly Slack community. Members also use the website at codebuddies.org to start study groups and schedule virtual hangouts. We have a pay-it-forward mentality. The platform, an open-sourced project , was painstakingly built by volunteer contributors to help members organize study groups and schedule focused hangouts to learn together. In those peer-to-peer organized remote hangouts, the scheduler of the hangout might invite others to join them in: Working through a coding exercise together Screen sharing and helping each other through a contribution to an open-sourced project Co-working silently in a “silent” hangout (peer motivation) Helping them practice their knowledge of a topic by attempting to teach it Reading through a chapter of a programming tutorial together Occasionally, the experience will be magical: a single hangout on a popular framework might have participants joining in at the same time from Australia, the U.S., Finland, Hong Kong, and Nigeria. The site uses the MeteorJS framework, and the data is stored in a MongoDB database. For years, with a zero budget, CodeBuddies was hosted on a sandbox instance from mLab. When we had the opportunity to migrate to MongoDB Atlas , our database was small enough that we didn’t need to use live migration (which requires a paid mLab plan), but could migrate it manually. These are the three easy steps we took to complete the migration: 1) Dump the mongo database to a local folder Once you have stopped application writes to your old database, run: mongodump -h ds015995.mlab.com --port 15992 --db production-database -u username -p password -o Downloads/dump/production-database   2) Create a new cluster on MongoDB Atlas   3) Use mongorestore to populate the dumped DB into the MongoDB Atlas cluster   First, whitelist your droplet IP on MongoDB Atlas: Then you can restore the mlab dump you have in a local folder to MongoDB Atlas: mongorestore --host my-awesome-cluster-shard-00-00-dpkz5.mongodb.net --port 27018 --authenticationDatabase admin --ssl -u username -p password Downloads/dump/production-database --- We host our app on DigitalOcean, and use Phusion Passenger to manage our app. When we were ready to make the switchover, we stopped Phusion Passenger, added our MongoDB connection string to our nginx config file, and then restarted Phusion Passenger. --- CodeBuddies is a small project now, but we do not want to be unprepared when the community grows. We chose MongoDB Atlas for its mature performance monitoring tools, professional support, and easy scaling.

March 27, 2018