2.4. External Materialization and Red Hat JBoss Data Grid


Red Hat JBoss Data Grid can be used as an external materialized data source system in order to improve query result performance. You can use a JDBC data source for the same reason.

Note

You can also define the materialization through a dynamic VDB. To learn how, look at the [EAP_HOME]/quickstarts/jdg7.1-remote-cache-materialization quick start.

Important

When DDL metadata changes, the only way to promote the change is restart the Red Hat JBoss Data Grid instance. This also impacts VDB versioning.

Important

You cannot query a cache if it contains multiple pojos.

2.4.1. Materializing a View

Prerequisites

You must have two caches and the teiid-alias-naming-cache in Red Hat JBoss Data Grid. (The teiid-alias-naming-cache only needs to be created once because it is shared across all the materializations stored in the Red Hat JBoss Data Grid instance.)

  1. Using Teiid Designer, click on a view that is to be materialized.

    Note

    Make sure the view has a primary key defined as the Red Hat JBoss Data Grid source table needs one for updates. Otherwise, you will need to manually create a primary key on each of the new JDG source tables.
  2. Right-click on the view and click Modeling->Materialize.
  3. Enter the primary and staging cache names.
    Optionally, you can change the JDGSource model name and the directory in which the model is saved.

    Note

    Red Hat JBoss Data Grid restricts the name of the source model because the protobuf code is based on the Java package naming constraints. The model name becomes the package name in the .proto file. This is due to a limitation in the way that the protobuf is defined. Because Red Hat JBoss Data Grid uses Java, the package name must follow the Java package naming standards. Dashes, for instance, are not allowed.
  4. Click Finish.
  5. To control the materialization process, update the materialized view extension properties on the above selected view:
    • MATVIEW_TTL - to set the refresh rate, in milliseconds
    If the materialization management status table is used, then set the following extension properties:
    • ALLOW_MATVIEW_MANAGEMENT = true
    • MATVIEW_STATUS_TABLE = {status table name}
  6. Create the VDB, using the models needed for materialization.
    For the JDGSource model, be sure the JNDI is mapped to the JDG data source. Also, enable native queries. To do this, create a translator override for the infinispan-hotrod translator. Click the supportsDirectQueryProcedure property and set the value to true.
  7. Deploy the VDB.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.