A music-streaming company stores user profiles in a NoSQL document database instead of a relational database. Each profile is stored as one document, for example:
{ "userID": "u4471",
"name": "Priya",
"playlists": ["Gym", "Revision"],
"devices": [{"type": "phone", "os": "Android"}] }(a) Outline what is meant by a NoSQL database. [1]
(b) Outline two reasons why a document database suits these user profiles better than a relational database. [2]
- (a) A database that does not store data in related tables of fixed rows and columns / is non-relational (e.g. uses documents, key–value pairs, wide columns or graphs); accept "not only SQL" only if non-tabular storage is mentioned(1)
- (b) First reason, any one from: flexible / dynamic schema, so different profiles can hold different fields (e.g. extra devices, no playlists) without altering a table structure or storing many NULLs / nested or array data (playlists, devices) is stored inside one document, so a whole profile is read in one access with no joins / scales out horizontally across many servers to handle millions of users(1)
- (b) Second reason: a different one from the list above, outlined and linked to the profiles. Do not award two reasons that are the same idea(1)
- Answer: Non-relational storage; flexible schema; nested data read without joins (or horizontal scaling).
- Examiner tip: Saying "NoSQL means no SQL" earns nothing; say how the data is stored instead of tables.