CodeIEB
Theory Notes/🗄️ Topic 4: Data & Information Management, Solution Development/12.4.7
12.4.7Grade 12

JSON Files & Comparing Persistence Methods

A structured, modern alternative to plain text files for storing and transferring complex data. Not examinable in the practical exam.

JSON (JavaScript Object Notation)
A lightweight, human-readable text format for storing and transferring structured/complex data, built around key-value pairs, arrays, and nested objects.

Example

{ "name": "Ana", "grade": 11, "subjects": ["Maths", "IT", "English"] }

Purpose and function: JSON is widely used for transferring structured data between systems (e.g. a web app and a server/API) because its format naturally maps to objects, arrays, and nested structures in most modern programming languages.

FormatStructureBest forLimitation
Text fileSimple, flat lines of delimited dataVery simple data, quick to implementAwkward for deeply nested/complex data; no built-in querying
JSON fileStructured, nested key-value dataComplex/nested data, exchanging data between systemsStill just a file — no built-in multi-user access control or complex querying like a database
DatabaseStructured tables with relationships and a query language (SQL)Large-scale, multi-user, relational data needing complex queriesMore setup/overhead than a simple file for small, one-off tasks

💡 Exam Tip

If asked to justify choosing JSON over a plain text file, the strongest point is that JSON's nested structure naturally represents complex/hierarchical data (like an object with an array field) far more cleanly than a flat delimited text line.