Now that "NOSQL" or "object only" storage systems like MongoDB or memcached are really picking up steam in the world. I was wondering if there are any requests that cannot be performed on them that can be performed using multiple object joins (in SQL that is JOIN "table"
). In other words, are there any multi-table queries that cannot be handled by several single table queries in a row?
Basically, is there a use-case were a multi-table join cannot be replicated by accessing one table at a time in object based storage systems?
Here are some examples of normal 3NF queries using has_man and has_many_through relations. These aren't the most complex queries - but they should give you a starting point for the concept. Note that any value in {} means a value of the result of the last query.
Company Has Many Users
SELECT user.*, company.name as company_name FROM user
LEFT JOIN company ON company.id = user.company_id
WHERE user.id = 4
vs
SELECT * FROM user WHERE id = 4
SELECT * FROM company WHERE id = {user.comany_id}
Club Has Many Students Through Memberships
SELECT student.* FROM student LEFT JOIN membership on
membership.student_id = sudent.id WHERE membership.club_id = 5
vs
SELECT * FROM membership WHERE club.id = 5
SELECT * FROM student WHERE id = {membership.student_id}
The reason I'm wondering is because I want to know if Object-based systems (that rely on accessing single table objects at a time) can do what RDBMS databases like PostgreSQL or MySQL can do.
So far the only thing wrong seems to be that more queries are necessary.