title: What is the advantage of storing schema in avro?
body: <p>We need to serialize some data for putting into solr as well as hadoop.</p>
  
  <p>I am evaluating serialization tools for the same.</p>
  
  <p>The top two in my list are Gson and Avro.</p>
  
  <p>As far as I understand, Avro = Gson + Schema-In-JSON</p>
  
  <p>If that is correct, I do not see why Avro is so popular for Solr/Hadoop?</p>
  
  <p>I have searched a lot on the Internet, but cannot find a single correct answer for this.</p>
  
  <p>Everywhere it says, Avro is good because it stores schema. My question is what to do with that schema?</p>
  
  <p>It may be good for very large objects in Hadoop where a single object is stored in multiple file blocks such that storing schema with each part helps to analyze it better.
  But even in that case, schema can be stored separately and just a reference to that is sufficient to describe the schema. I see no reason why schema should be part of each and every piece.</p>
  
  <p>If someone can give me <strong>some good use case how Avro helped them and Gson/Jackson were insufficient for the purpose</strong>, it would be really helpful.</p>
  
  <p>Also, official documentation at the Avro site says that we need to give a schema to Avro to help it produce Schema+Data.
  My question is, if schema is input and the same is sent to output along with JSON representation of data, then what extra is being achieved by Avro? Can I not do that myself by serializing an object using JSON, adding my input schema and calling it Avro?</p>
  
  <p>I am really confused with this!</p>