liveBook · Manning

JSON

As explained in Microservices Patterns, Second Edition

JSON is a text-based data interchange format that represents structured data using objects, arrays, and primitive values.

JSON is a text-based message format suited to cross-language communication. Its named properties make messages human-readable and self-describing, so consumers can use the values they need and ignore others; this can make many schema changes backward-compatible. section 8.1.6

JSON Schema can specify property names, types, and requiredness, and can document and validate incoming and outgoing messages. Text formats add property-name overhead and can be inefficient to parse, especially for large messages; consider binary formats when efficiency and performance matter. section 8.1.6

Table 8.3 The benefits and drawbacks of text-based vs. binary formats for message payloads

Format

Benefits

Drawbacks

Text

  • Human-readable
  • Simple to process
  • Self descriptive
  • Verbose
  • Inefficient to process large messages

Binary

  • Compact
  • Fast to process
  • Requires more tooling
  • Not human-readable

Compare text formats such as JSON with binary formats on readability, processing efficiency, and tooling. section 8.1.6

How Microservices Patterns, Second Edition covers it

How deep it goes
Describes JSON as human-readable and self-describing, and connects JSON Schema to validation; stops short of syntax details.
What you can do after
Apply it via JSON Schema to document and validate incoming and outgoing messages.
How it connects
Connects JSON to interprocess communication, message schemas, XML, and Protocol Buffers.

Also explained in

Compare how 42 books explain JSON →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.