Can one make a relational database using MongoDB?

İlker Dağlı picture İlker Dağlı · Nov 15, 2011 · Viewed 34.5k times · Source

I am going to make a student management system using MongoDB. I will have one table for students and another for attendance records. Can I have a key in the attendance table to reach the students table, as pictured below? How?

diagram of a relational database

Answer

Mike Christensen picture Mike Christensen · Nov 15, 2011

The idea behind MongoDB is to eliminate (or at least minimize) relational data. Have you considered just embedding the attendance data directly into each student record? This is actually the preferred design pattern for MongoDB and can result in much better performance and scalability.

If you truly need highly relational and normalized data, you might want to reconsider using MongoDB.