What is it and what is Odata for?

Asked

Viewed 4,985 times

16

I’ve been getting a few people talking about OData, I did some research I saw some codes, but I didn’t understand some things, among them:

  • What good is Odata?
  • What are the advantages and disadvantages?
  • When to use Odata?
  • When not using Odata?
  • Odata serves to create and consume REST Apis. I do not believe that there is a better definition and documentation than that found on the official website http://www.odata.org/

1 answer

15


The Odata (Open Data Protocol) defines a set of best practices for creating and consuming Apis Restful. Odata helps you focus on your logic when creating Apis Restful without having to worry about the various approaches for defining request and response headers, status codes, HTTP methods, URL conventions, media types, load formats, query options etc.

The exponential growth of Saas applications led to an explosion of Apis REST. This means that a developer will spend most of the time learning new Apis instead of creating the app itself. To solve this problem, Microsoft created the Odata standard to create Apis REST.

What good is Odata?

The protocol allows the creation and consumption of Apis REST, which allow web clients to publish and edit resources using Urls and defined in a data model, using simple HTTP messages. Supports HTTP formats, Atom Pub and JSON.

What are the advantages and disadvantages?

Perks:

  • Supports any type of data source, even a custom class of its own.
  • No need to create a proxy service object. So, it’s light to use.
  • You can create your own custom methods and expose them.
  • As it is light, the interaction between server and client is fast. Thus, it presents a good performance.
  • Offers full support to CRUD using the different HTTP methods:

    • GET: gets one or multiple entries.
    • POST: creates a new entry.
    • PUT: updates an existing entry.
    • DELETE: removes an entry.

Disadvantages:

  • Since it is purely URL-based, it is less secure.
  • Not every query operator on LINQ is available in Odata as filter, Skip, take etc..

When to use Odata?

As the explosion of Apis continues, each organization exposes its own Apis REST/SOAP/Bulk exclusive to the consumption of your data. And some of them also create their own unique query languages, such as ROQL (Oracle Service Cloud), SOQL (Salesforce), etc. This makes it difficult for a company and its development team to learn and program all of these features, with different Apis.

This is where Odata is very useful. Odata advocates a standard way of implementing Apis REST which enables SQL-like query features using these Apis Restful. Odata is essentially SQL for the web created over the standard protocols - HTTP, JSON and ATOM - while taking advantage of the REST architecture style.

When not using Odata?

Note the items in Disadvantages listed in topic "What are the advantages and disadvantages?".


References:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.