https://avro.apache.org/docs/current/
Introduction
Apache Avro? is a data serialization system.
Avro provides:
- Rich data structures.
- A Compact, fast, binary data format.
- A container file, to store persistent data.
- Remote procedure Call (RPC).
- Simple integration with dynamic languages. Code generation is not required to read or write data files and to the use or implement RPC protocols. Code generation as an optional optimization, only worth implementing for statically typed languages.
Schemas
Avro relies on schemas. When Avro data was read, the schema used when writing it was always present. This permits all datum to is written with no per-value overheads, making serialization both fast and small. This also facilitates use with dynamic, scripting languages, since data, together with its schema, is fully self-describin G.
When Avro data was stored in a file, the IT schema is stored with it and so the files may be processed later by any program. If The program reading the data expects a different schema this can be easily resolved, since both schemas is present.
When Avro are used in RPC, the client and server Exchange schemas in the connection handshake. (This can is optimized so, for most calls, no schemas is actually transmitted.) Since both client and server both has the other's full schema, correspondence between same named Fields, missing fields, Extra fields, etc. can all be easily resolved.
Avro schemas is defined with JSON. This facilitates implementation in languages that already has JSON libraries.
Comparison with other systems
Avro provides functionality similar to systems such as Thrift, Protocol buffers, etc. Avro differs from these systems in the following fundamental aspects.
- Dynamic Typing: Avro does not require that code is generated. Data is all accompanied by a schema, this permits full processing of the that data without code generation, static datatypes , etc. This facilitates construction of generic data-processing systems and languages.
- untagged Data: Since The schema is present if data is read, considerably less type information need be encoded With data, resulting in smaller serialization size.
- No manually-assigned Field IDs: When a schema changes, both the old and new schema is always present when proces Sing data, so differences is resolved symbolically, using field names.
Avro schemas is defined with JSON. This facilitates implementation in languages that already has JSON libraries.