Interface Description Language

It’s a format used to describe the interface of an application(App1) in a language independent way so that any application(App2) can use this format and communicate with this application(App1).

For example, An application(App1) is written in Java language assume this as web services and an another application(App2) wants to consume the App1 services. So we have to define and describe the App1 services in IDL language so that this can be used by other application(App2) easily.

Few of IDL languages are given below,

Web Services Description Language
Web Application Description Language
RESTful Service Description Language
Protocol Buffer
Apache Thrift
Avro IDL
JSON-WSP
 

 

Advertisements

Apache Avro – Example(Serialization and Deserialization)

I have used Protocol Buffer and just want to learn Avro. Here are few points from my learning.

Avro is extensively used in the Hadoop ecosystem. The schema should be defined in .avsc file. Please refer the below example schema file


{
	"namespace": "com.avro.entity",
	"type": "record",
	"name": "User",
	"fields": [
		{"name": "id",  "type": ["int", "null"]},
		{"name": "fName", "type": "string"},
                {"name": "lName", "type": "string"}
	 ]
}

Once define the schema file, then java classes needs to be generated for that schema file. Then the same java classes needs to be used in the applications.

We can either create the java classes with that schema or we can use the schema file directly in the application.

Please refer the below Github repo to know the serialization and deserialization of avro content.

https://github.com/dkbalachandar/avro-example