Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Database for a Social Network with AngularJS, PhoneGap and NodeJS

Hi guys,

im currently trying to implement a simple social network app which will be ported to mobile devices via PhoneGap. The Server will be written in NodeJS + Express and the Frontend uses AngularJS. Im stuck at chosing the right Database for my purpose and im wondering whether i could use MongoDB for this or use standard MySQL. I would really like to use somethink like NoSQL or somethink similar to Active Records in Ruby. Can someone help me with this desicion?

Best regards Dominic

2 Answers

Hi, Dominic Elm :

I'll do my best to help you. Without knowing too much about the business logic your social network app will have, MYSQL would definitely not be the best choice compared to a NOSQL database such as MongoDB, RavenDB, CouchDB.

I would say PostgreSQL or a NOSQL database like the ones I've mentioned above are your best options.

PostgreSQL undoubtedly is the most advanced relational database. It even has NOSQL capabilities as a result of having a hStore datatype. It even has a JSON datatype.

Research has shown hStore to be much faster than MongoDB.

Being a user of PostgreSQL, MongoDB, as well as Redis, I usually use PostgreSQL to begin things off because most people don't understand how to view things in a document-driven way that NOSQL databases such as MongoDB requires you to, and you can have the advantages of a traditional relational database and a NOSQL database through PostgreSQL.

I hope that helps.

Thanks Kevin! Your explanation was clear and helpful. I pretty much like idea behind the hStore datatype and even more the fact that it is much faster. So i guess i will go for PostgreSQL as a database for my social network.

Sorry, i wanted to comment your post and not post it as an answer.