concept JSON in category apache thrift

appears as: JSON
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

Simple Object Access Protocol (SOAP) is a W3C recommendation (https://www.w3.org/TR/2007/REC-soap12-part1-20070427/) specifying a Service Oriented Architecture (SOA)-style remote procedure call (RPC) system over HTTP. SOAP relies on XML for carrying its payload between the client and server and is typically deployed over HTTP, though other transports can also be used. Optimizations are available that attempt to reduce the burden of transmitting XML, and SOAP has versions that use JSON, among other offshoots. Related technologies, such as XML-RPC, operate on similar principles. Unlike RESTful services, which directly use HTTP headers, verbs, and status codes, SOAP and XML-RPC systems tunnel function calls through HTTP POST operations, missing out on most of the caching and system layering benefits found in RESTful services.

The key benefit of HTTP-friendly technologies is their broad interoperability. By transmitting standards-based text documents (XML, JSON, and others) over the ubiquitous HTTP protocol, almost any application or language can be engaged. Human-readable XML/JSON payloads also greatly simplify prototyping, testing, and debugging. On the downside, each language, vendor, and, often, each company provide their own scheme for generating stubs. You have no guarantees that code generated by different SOAP WSDL (Web Service Description Language) tools will collaborate.

Many distributed applications use XML or JSON to provide a central data representation; however, these formats only supply part of the solution. Much work must be done to produce a standardized XML or JSON format that can be used to serialize native types across languages. For example, how will binary blocks of data be handled, what will happen when data fields are missing or unexpected data fields are present, what complex types will be supported, and how will they be represented? Several classes of serialization problems are solved by the Apache Thrift framework, not the least of which is the code needed to perform the serialization.

JSON is a text-based protocol, so we can display the contents of the file written. The output is easy enough to read, though the size of the generated file is the largest of these examples. Apache Thrift emits the field ordinals rather than the field names in the serialized output, saving space but making the data a little harder to interpret directly. However, the upside is that JavaScript and other JSON-enabled platforms can easily communicate with any language using the JSON protocol.