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 8.11 Beta1 and 8.10.1 Released

Teiid 8.11 Beta1 is now available from the  downloads  and maven.  Feature highlights since Alpha2 include: TEIID-3434 More caching control over ttls in the result set cache down to the schema/table level. TEIID-3412 MS Access support via the UCanAccess driver. The UCanAccess support is necessary for those running on Java 1.8 as the JDBC ODBC bridge has been removed from the JRE. The waiting continues on EAP 6.4 Alpha1 - it still should be available shortly and should be the platform target for Teiid 8.11 Beta2. Of course, let us know if you find any issues with these early releases.  There's still plenty of time to get fixes into the final release. Teiid 8.10.1 is also available.  It addresses 5 important issues discovered since 8.10 was released: [ TEIID-3409 ] - PostgreSQLExecutionFactory TranslatorProperty annotation in wrong place [ TEIID-3437 ] - Inconsistencies with row count handling [ TEIID-3438 ] - Null value returned from BlobImpl

Tech Tip: Teiid SQL Language MAKEDEP Hint Explained

In this article I will explain what a MAKEDEP hint is, how and when, why it should be used in Teiid. What: MAKEDEP is query hint.  When a query hint is defined in the SQL query it influences the Teiid query planner to optimize the query in a way that is driven by the user. MAKEDEP means "make this as a dependent join". What is a Dependent Join? For example if we have query like: SELECT * FROM X INNER JOIN Y ON X.PK = Y.FK Where the data for X, and Y are coming from two different sources like Oracle and WebService in Teiid, so in relational algebra you can represent above query as Here the result tuples from node X and node Y are being simultaneously fetched by Teiid query engine, then it joins the both the results inside Teiid engine based on the specified X.PK = Y.PK condition and returns the filtered resulted to the user. simple.. Now, what if, if X table has 5 rows and Y table has 100K rows? In order to do the JOIN naively Teiid need sto read all the 5

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