I'm curious how the "Reader" and "Writer" terminology came about, and, most importantly, whether it's as confusing to the rest of you as it is to me?

As I understand it, the principal analogy here is from the RPC world - a process A writes some Avro to process B, in which case A is the writer and B is the reader.

And there is the possibility that the schema which B may be expecting isn't what A is providing, thus B may have to do some conversion on its end to grok it, and Avro schema resolution rules may make this possible.

So far so good. This is where it becomes confusing. I am lost on how the act of reading or writing is relevant to the task at hand, which is conversion of a value from one schema to another.

As I read stuff on the lists and the docs, I couldn't help noticing words such as "original", "first", "second", "actual, "expected" being using alongside "reader" and "writer" as clarification.

Why would be wrong with a "source" and "destination" schmeas?

Consider the following line (from Avro-C):

    writer_iface = avro_resolved_writer_new(writer_schema, reader_schema);

Here "writer" in resolved_writer and writer_schema are unrelated. The former refers to the fact that this interface will be modifying (writing to) an object, the latter is referring to the writer (source, original, a.k.a actual) schema.

Wouldn't this read better as:

    writer_iface = avro_resolved_writer_new(source_schema, dest_schema);

Anyway - I just want to know if I'm missing something obvious when I think that reader/writer is confusing.

Thanks,

Grisha

Reply via email to