What is OData? ADVANTAGES AND DISADVANTAGES

2

 

OData is the Open Data Protocol. It is an open web protocol started by Microsoft to expose data using existing web technologies. This is based on Representational State Transfer (REST) full architecture. HTTP, AtomPub (similar to RSS, but specifically introduced special XML format for OData), JSON are all supported.
Here, the URL is the primary operator on the data query.

WCF OData Service

In Visual Studio 2013, there is a template to create a WCF OData service. So, we can easily create an OData Service using Visual Studio 2010.

Example of OData Service has been used

  1. Last (2010) football world cup (S.A), the scoring website was done using an OData Service.

Why should we use an OData Service? 

  1. OData is based on the REST architecture, so we can retrieve data based on an URL.
  2. It also supports HTTP, Atom Pub as well as JSON format.
  3. It has support for any type of data source. Even you can use a custom class as a data source.
  4. No need to create a proxy service object. So, it is lightweight to use.
  5. You can create your own custom methods and expose it.
  6. Since it is lightweight, the interaction between server and client is fast. Thus, performance is good.
  7. It offers full CRUD support by using the different HTTP methods:
    • GET: Gets one or many entries.
    • POST: Create a new entry.
    • PUT: Update an existing entry.
    • DELETE: Remove an entry.

 

  1. A WCF Data service can expose an entity model via an URI.
  2. A WCF Data service could be consumed by any type of client like Windows, SilverLight, Web, AJAX and console.

Limitations

  1. Since it is purely URL based, it is less secure.
  2. As per my observation, not every query operator in LINQ is available in OData like Filter, Skip, Take etc.

Where is it suitable to use it?

  1. The case in which performance is more important than security. For example, as I said before it was used in the 2010 Football World Cup scoreboard.

Working of a WCF Data Service

There are five components.

  1. DataBase.
  2. Data Access layer using ADO.Net Entity model or LINQ.
  3. Entity Model Implementing Iqueryable and Iupdatable Interface.
  4. WCF Data Service exposing CRUD Operations on entity model as REST Service.
  5. Consuming it on various types of clients.

Supported Message Format

  1. JSON
  2. XML (ATOM)

 

3 thoughts on “What is OData? ADVANTAGES AND DISADVANTAGES

  1. Pingback: O que é e para que serve OData? - terminologia asp.net-web-api - Perguntas e Respostas

  2. Pingback: terminology – What is and what is OData for? - YeahEXP

  3. Pingback: terminologia – What is OData and what is it for? - YeahEXP

Leave a comment