NoSQL types: key-value, document, wide-column, graph
"NoSQL" is a family name for databases that don't store data as relational tables. There are four main kinds, and each is built around one way of reaching your data. Interviewers want you to know which question each kind answers quickly, and which it can barely answer at all.
Four ways to keep track of things
Think of four ways people keep records.
- A coat check. You hand over a coat and get ticket 57. Show the ticket and the coat comes back at once. Ask "which coats are red?" and the attendant has to walk past every hook.
- An accountant's client files. Everything about one client sits in one folder, letters and forms of any shape. One fetch gives you the whole story.
- A diary per person, entries in date order. Open Ana's diary at 3 March and read on: quick. "Who wrote about rain on 3 March?" means opening every diary.
- A family tree. The lines between people are the point. "Who are my second cousins?" is a walk along the lines.