CompTIA Data+ (DA0-002)Data Concepts and EnvironmentsMedium
A software development team is building a new microservices-based application. They need a lightweight, human-readable file format to exchange configuration data and API responses between different services. The format must support nested structures and arrays. Which file format would be the most suitable choice?
- ACSV
- BJSON
- CPlain Text
- DXML
Show answer & explanationAnswer & explanation
Correct answer: B. JSON
JSON (JavaScript Object Notation) is a lightweight, human-readable data interchange format that is ideal for configuration files and API responses due to its support for nested structures, arrays, and broad compatibility across programming languages.
Why the other options are wrong
- A. CSV (Comma Separated Values) is a tabular format and does not easily support nested structures or arrays, making it unsuitable for complex configuration or API responses.
- C. Plain Text is too unstructured for configuration data that requires specific key-value pairs and nested hierarchies.
- D. XML (Extensible Markup Language) supports nested structures and is human-readable, but it is generally more verbose and heavier than JSON, making JSON a more lightweight choice for microservices.
JSON (JavaScript Object Notation)
A lightweight, human-readable data interchange format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types.
- Lightweight and commonly used for web applications.
- Supports nested structures and arrays.
- Human-readable and easy to parse.
- Language-independent, widely supported across programming languages.
Memory trick: JSON is 'J'ust 'S'imple 'O'bject 'N'otation.