Home / Knowledge / OData

What is OData and what is it used for in industry?

Short answer

OData is an open, REST-based protocol that lets applications query and update data over HTTP. Each data source describes its own data model and understands the same standardized queries. That saves custom interfaces between ERP, MES and analytics, but it does not replace machine protocols or real-time data streams.

Reading time 7 minutesEditorial team, inray Industriesoftware
One pattern instead of many interfaces

Definition: OData

OData stands for “Open Data Protocol”. It describes how data services are built in the REST style: clients read and change resources using ordinary HTTP messages, resources are addressed by URLs, and a data model describes which objects and properties exist. That is how the OASIS OData specification puts it.

The practical gain lies in uniformity. If you know one OData service, you can use the query logic of a second one without learning anything new. The table compares OData with a custom-built interface.

Criterion Custom interface OData
Data model Documented per project, often only in text Machine-readable in the metadata document ($metadata)
Queries Defined anew for each interface Standardized options such as $filter, $select and $top
Transport Arbitrary HTTP with GET, POST, PUT, PATCH and DELETE
Standardization None OASIS standard, ISO/IEC 20802

Why a standard makes sense

The idea of shared data access is older than the standard. In May 2012, Microsoft, IBM and others proposed an OData technical committee at the standards body OASIS, and Microsoft contributed seven specification components. OASIS approved OData 4.0 as a standard on 24 February 2014, and in 2016 it was accepted as ISO/IEC 20802. OData 4.01 followed on 23 April 2020.

A back-of-the-envelope calculation shows why this matters for connections. Purely as an illustration: six systems that each talk to one another individually need up to 6 × 5 / 2 = 15 connections. If all six speak the same standard through a shared layer, it is six connections. The figures are a worked example, not a measurement from a project.

What OData consists of

OData is not a single document but a family of specifications. The overview lists the parts used most often in practice.

Building block Purpose Source
Protocol (Part 1) Covers resource model, HTTP methods, service document, metadata, batch and change tracking OASIS, 2020
URL conventions (Part 2) Defines how sets, keys and query options are written in URLs OASIS, 2020
Data model (CSDL) Describes types, sets, relationships, functions and actions in XML or JSON OASIS, 2020
JSON format Defines how data is transferred as JSON OASIS, 2014

How OData works technically

Four mechanisms carry the standard.

  • Addressing: A set sits behind the service path, for example Products. A single record is addressed by its key in parentheses, for example Products(1).
  • Query options: $filter narrows records, $select chooses properties, $expand includes related data, and $orderby, $top and $skip sort and page.
  • Write access: Records are created with POST, changed with PATCH or PUT and removed with DELETE. ETags protect against overwriting when two users change a record at the same time.
  • Metadata and batch: The service document lists the available sets, and $metadata describes the model. Batch requests bundle several operations into one call.

Four steps to a connection

The sequence is similar for most connections.

  1. Clarify the data model

    Which objects do you need, such as orders, materials or sites, and which properties are required for that?

  2. Check the service

    Retrieve the service document and $metadata. They show which sets and fields the service actually offers.

  3. Define queries and access

    Define filters and fields so that only the necessary data is transferred, and clarify authentication and permissions.

  4. Operate and maintain

    Monitor response times and errors, and allow for the fact that the service’s model can change.

What OData is not

Four distinctions prevent common misunderstandings.

  • Not a machine protocol: OData talks to data services, not directly to a controller. Protocols such as OPC UA or Modbus exist for that.
  • Not a data stream: OData works with request and response over HTTP. For events a sender distributes continuously, protocols such as MQTT are a better fit.
  • Not a database: OData describes access, not storage. Any data store can sit behind it.
  • Not just any REST: OData adds fixed rules for model, queries and errors to REST. An arbitrary JSON service is therefore not yet an OData service.

Typical hurdles in practice

The hurdles rarely lie in the protocol, but in what is provided behind it.

  • Services in different OData versions that a client has to handle separately
  • Queries that are too broad, such as $expand across many relationships, which raise response times
  • Unclear permissions: who may read or change which sets?
  • Fields with the same name but different meaning in different systems
The honest part

OData standardizes access, not the meaning of data. Two systems can both speak OData and still mean different things by “order” or “site”. That shared understanding has to be clarified by the business. pronubes does not do this for you and does not turn a poorly described service into a reliable one.

How pronubes helps

For pronubes, OData is one possible way into source and target systems. The product parts take on different tasks.

  • pronubes Edge: Edge connects machines, plants and target systems without a separate interface project for each link. Systems with a standardized interface are particularly well suited.
  • pronubes Zones: Zones maps sites, production areas, systems and data flows in a clear structure. This helps assign data from an OData service unambiguously to the right site and area.
  • pronubes Insights: Insights shows whether connections and data flows run stably in live operation. You see early when a service responds slowly or returns errors.
Glossary
OData
Open Data Protocol, REST-based protocol for querying and updating data over HTTP.
REST
Architectural style for services that address resources through URLs and HTTP methods.
OASIS
Standards body that has maintained OData as a standard since 2014.
Entity set
A set of like records reachable under one URL.
Service document
List of the sets and functions an OData service offers.
$metadata
Document describing the data model of an OData service.
CSDL
Common Schema Definition Language, the description language for the OData data model.
Query option
Parameter such as $filter or $select with which a client narrows the result.
ETag
Identifier of a record’s state that prevents simultaneous overwriting.
Batch
Bundling of several OData operations in one HTTP call.
Asked and answered

Frequently asked questions

What does OData stand for?

OData stands for “Open Data Protocol”. It is an open protocol with which applications read and change data over HTTP, based on a described data model.

Who standardizes OData?

The standards body OASIS. A technical committee was formed there in 2012, OData 4.0 became a standard on 24 February 2014 and was later accepted as ISO/IEC 20802. Version 4.01 followed on 23 April 2020.

Is OData the same as REST?

No. OData builds on REST and HTTP but adds fixed rules for data model, query options and error handling. An arbitrary REST service does not follow these rules automatically.

Is OData suitable for real-time machine data?

Rather not. OData works with request and response. For continuous events, protocols such as MQTT are better suited, and for the control level protocols such as OPC UA. OData fits business and master data above all.

How secure is an OData service?

That depends on the implementation. OData uses HTTP, so protection comes from mechanisms such as HTTPS, authentication and permissions in the service. You should clarify both before connecting.

Get started

Uniform data access starts with a shared architecture, not with the next single interface.

pronubes connects machines, plants and systems through one shared architecture instead of interface by interface.

pronubes by inray

pronubes is a product of inray Industriesoftware GmbH. Over 30 years of industrial software from Germany. Innovative and reliable for manufacturing companies.

inray