I have recently complete Hartl’s Rails tutorial, and have devised a little app that I would like to try to build out. I would like to understand whether I would need to learn, and integrate a separate database (such as PostgreSQL) to my Rails model in order to model the functions that involves matching users based on shared qualities with each other.
For example, if user a and user z both indicates that they like chinese food as well as like spicy meatballs, they would be “matched” with each other, where either users could initiate a “friendship request”. However, if a were to like the food items described, but user b like spicy meatballs and like tapas, a and b would not be matched with each other (because they only like 1 thing in common.. or some other stupid matching logic 🙂 ). Of course, the actual model may be slightly more complicated than this, where there may be other factors like “music” or “sport”, in which a matching process would consider certain qualities superior, and weighs them more than others in a matching process.
My questions are –
- Would Rails be sufficient to handle the slightly complex database described above, where users enter their info, and a “black box” model would then spit out matches? Are there any resources that I could look into to learn more about databases in Rails?
- If not, which type of database would you recommend that I learn more about? Would PostgreSQL be a good candidate?
Thanks!
Edit –
For clarification, my question stems from the topic discussed in this part in the tutorial, where it noted about how working with Rails could enable one to “barely ever have to think about how Rails stores data”. I was wondering if this would still be the case when the database would need to perform some type of work, such as matching, on its own.
Wow wow wow. Firstly rails isn’t a db. Models are reflections of databases and a structured way to view records as instance variables.
So yes you need a db. Recommend you start yourself off with SQLite since its nice and small and data lives as a file within your app. Then upgrade MySQL later on (NB: this is generic advice without knowing what projects you might do next).
Resources:
I highly recommend Railscasts.com
Start with this one and work your way up:
http://railscasts.com/episodes/310-getting-started-with-rails