What is a key-value pair — CCA-F Exam Prep

PencilPrepPencilPrep
L0.08|What is a key-value pair
1/12
Real person
A customs officer at JFK airport scanning a passport. On screen next to them: Name: Danny, Nationality: Canadian, DOB: 1990-03-15. Three clean lines of data. The officer glances at the screen, then at the traveler. Two seconds.

A customs officer at JFK scans your passport.

Name: Danny. Nationality: Canadian. DOB: 1990-03-15.

Three key-value pairs. In 2 seconds, the officer knows who you are, where you're from, and how old you are.

Not three labels. Not three values. Three PAIRS. Each label married to its value. Name doesn't float around looking for data. It's locked to "Danny."

A key-value pair is a complete thought. Key asks. Value answers.