Skip to main content

OData Support In Teiid

What Is OData?

"The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. The protocol emerged from experiences implementing AtomPub clients and servers in a variety of products over the past several years.  OData is being used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites. " - taken directly from http://www.odata.org

 OData is specification from OASIS committee, and this specification is backed by Microsoft, SAP AG, IBM, Citrix, Progress Software and WSO2.

Why you need OData?

In today's service oriented enterprise architectures more and more companies are exposing their enterprise data and business services using the REST based services. Even though REST defines easy ways to access your services, it does not define a unified calling semantics to access your services nor provides details data model. Thus everybody inventing their own REST API access mechanisms, defining specific ways define their data model to the end user application.  OData fills this gap, and provides specification that defines standard ways define CRUD operations on your data source along with standard ways to define your data/schema model.

How OData helps?

If an enterprise implements OData specification to expose their data and services, this layer self describes the data model and will define standard ways access and query in very powerful ways. Thus the client applications that are trying to use these services can write their applications using the rich metadata provided by OData and at the same time avoid vendor lock-in as it is a standard.

For example, Netflix a on-line movie streaming service, exposes details about their movie catalogue using OData. Using this service any developer who is writing a enterprise application or mobile application, can show case movies and details about them using OData. Since the OData also exposes the data/schema model about the services, they are self explanatory.

Another example is SAP Netweaver Gateway. SAP also uses OData to expose their services to end customers. The result, customers know exactly how to access SAP services and integrate them in their applications.

See the growing ecosystem of OData implementations.

What this got to do with Teiid?

Well, good question. A LOT.

Teiid is a data integration and virtualization engine. Teiid provides seamless integrations with many different varieties of sources like RDBMS, Flat Files, Web Services, packaged applications etc.  So, OData was a natural fit to provide features around data integration.

The support for OData in Teiid is two (2) fold.

OData Translator - Using this translator, you can bring in any OData sources as part of virtual database you create in Teiid and integrate this source's data with any other sources. Given SQL based user query, Teiid is capable of converting that request into a REST based OData call and fetch the results automatically and provide them in a relational perspective.

OData Server - If you have created a virtual database using Teiid, then with out any additional work, you can expose your VDB through OData. Previously Teiid only supported access through JDBC, ODBC and custom SOAP and REST  protocols. Now Teiid supports ability to access your VDB using OData.

Teiid uses couple different frameworks to make this possible. Primarily, the OData support is provided through OData4J project. Then Resteasy used for rest engine inside JEE container. Since Teiid server is already installed inside a JBoss Application Server, there is no more additional software you need to install. Both the translator and server are available when you install Teiid on JBoss AS.

How can I use them? any examples?

The support for both features is available in Teiid 8.3 Beta2  or later. I am in process of writing two more blogs in next couple weeks, one on each feature as show case, how to use them. So, stay tuned. If you are eager, there is documentation available.



The translator usage is no different to others, so, take a test drive and let us know if you have any questions or see any issues.

Thanks

Ramesh..


Comments

  1. Hi Ramesh,

    I am using wildfly swarm and I have created Virtual Database through Teiid and whether I expose my VDB through ODATA?

    Thank you.

    ReplyDelete
  2. Arvind,

    With the move to WildFly 11 in the latest version of the WF-Swarm 2018.1.1, I see a module resolving issue with supporting OData. I am trying to find workarounds but so far not found any, that means it will take code change in Teiid as well as in WF-Swarm. So, I can provide the fix, but it may be beginning of next month when WF-Swarm can pick up that change.

    The above article obviously using the traditional client/server model, not WF-Swarm.

    BTW, you can use Teiid forums for any Teiid related questions.
    Ramesh..

    ReplyDelete

Post a Comment

Popular posts from this blog

Teiid Spring Boot 1.7.0 Released

Teiid Spring Boot version 1.7.0 to support Teiid 16.0 has been released. This release is mainly to support the Teiid's latest version.  In this release, the support for OpenAPI code generation based on VDB has been removed as there is no community interest and moreover it was at OpenAPI 2.0, and the industry has moved to 3.0 and beyond. There are no plans to further pursue this feature. VDB maven plugin was also removed, which was intended to be a replacement for the VDB importing feature was to be used when working on OpenShift, however, since it requires the Maven repository and does not completely represent the feature as defined on the WildFly based deployments this is also removed. You can still use the VDB import feature with Teiid Spring Boot, simply define the VDB with your "IMPORT DATABASE" statements and provide the additional files along with the main VDB file. During the start of the application, Teiid Spring Boot will load all the necessary DDL files for the ...

Expose Excel Data as OData feed using Teiid

For that matter you can expose any data source that is supported by Teiid through its translators as OData service. You can convert Relational databases XML, JSON, CSV files Web Services  Sales Force Excel documents sources, or write your on top of your specific source. Teiid added support for exposing its virtual database (VDB) as OData service without any additional work. Create a virtual database with your required sources and create any additional views and deploy in the the JBoss EAP 6.1 server, that has Teiid 8.3 or greater installed.  See https://docs.jboss.org/author/display/teiid84final/OData+Support  for more information. So, lets build a simple example of exposing the Excel Sheet. Teiid accesses Excel sheets via JDBC-ODBC bridge, and Windows OS provides a ODBC driver for Excel documents.  Edit the standalone-teiid.xml, and create Connection Factory jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};Dbq=c:\ODBC\ExcelDat...

Teiid 8.13.3 Released

Teiid 8.13.3 is now  available .  In total 8.13.3 addresses 10 issues since 8.13.2: [ TEIID-4028 ] - adding salesforce-34 resource adapter does not work through the cli [ TEIID-4066 ] - Odata translator ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl [ TEIID-4070 ] - Issues with resource adapters with api modules in wildfly [ TEIID-4089 ] - Teiid JDBC driver does not reset the update count when calling getMoreResults(int) [ TEIID-4093 ] - OData authentication fails with NPE when gss-pattern related properties are included in VDB [ TEIID-4096 ] - AssertionError with independent side of a dependent join that has an ordered limit [ TEIID-3050 ] - allow for more incremental insert with iterator [ TEIID-4075 ] - Netezza translator to support common table expressions [ TEIID-4098 ] - Always preserve columns order in google spreadsheets models [ TEIID-4046 ] - OData - $skip is bee...