Git Product home page Git Product logo

rhdg-on-eap's Introduction

Red Hat Data Grid on JBoss EAP

1. Introduction

This repository demonstrates how to use features of Red Hat’s latest Data Grid release on JBoss EAP applications.

2. JBoss EAP

JBoss EAP is an open source platform for highly transactional, web-scale Java applications. JBoss EAP combines the familiar and popular Jakarta EE specifications with the latest technologies, like Eclipse MicroProfile, to modernize your applications from traditional Java EE into the new world of DevOps, cloud, containers, and microservices.

2.1. JBoss EAP 7 features

  • Jakarta EE compatible: JBoss EAP 7.4 is Jakarta EE 8 compatible implementation for both Web Profile and Full Platform specifications.

  • Managed Domain: Centralized management of multiple server instances and physical hosts, compared to a standalone server that supports just a single server instance.

  • Management console and management CLI: New domain or standalone server management interfaces. The management CLI includes a batch mode that scripts and automates management tasks.

  • Simplified directory layout: The modules directory contains application server modules.

  • Modular class-loading mechanism: Modules are loaded and unloaded on demand. This practice improves security performance and reduces startup and restart times.

  • Streamlined datasource management: Database drivers are deployed similarly to other JBoss EAP services.

  • Unified security framework: Elytron provides a single unified framework for managing and configuring access for both standalone servers and managed domains.

Find here all the documentation for the latest release of JBoss EAP.

2.2. Installing JBoss EAP

This section explains how to install and upgrade the JBoss EAP server. The binaries are available on the RH downloads website.

  1. Download the latest version of the server (Currently 7.4) and its latest patch (Currently 7.4.3).

  2. Unzip the server .zip.

    cd ~/Downloads
    unzip jboss-eap-7.4.0.zip
    export EAP_HOME="/home/alvaro/Downloads/RHDG/jboss-eap-7.4/"
  3. Patch the server using the following command:

    $EAP_HOME/bin/jboss-cli.sh "patch apply jboss-eap-7.4.3-patch.zip"

More detailed information:

2.3. Running JBoss EAP

Run the server instance with the following command:

${EAP_HOME}/bin/standalone.sh -c standalone-ha.xml
${EAP_HOME}/bin/add-user.sh -u 'admin' -p 'admin'

You should see the following output:

11:43:40,187 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.3.GA (WildFly Core 15.0.6.Final-redhat-00003) started in 6477ms - Started 336 of 669 services (451 services are lazy, passive or on-demand)
11:43:40,191 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
11:43:40,192 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

More detailed information:

3. Infinispan

The infinispan subsystem provides caching support for JBoss EAP. It allows you to configure and view runtime metrics for named cache containers and caches. It provides value as a standard architectural component in application infrastructures for a variety of real-world scenarios and use cases:

  • Data caching and transient data storage.

  • Primary data store.

  • Low latency compute grid.

More detailed information:

3.1. Configure Infinispan submodule

Use the Infinispan submodule to create a common cache for your applications:

${EAP_HOME}/bin/jboss-cli.sh -c --file=jboss-cli/standalone-local.cli

# Outcome
{"outcome" => "success"}
{"outcome" => "success"}

4. The client application

We have created a small application to test the previous mentioned features of Infinispan for JBoss EAP. It is a Java application that allows to perform CRUD operations to a cache.

4.1. Deploy the client application

In order to run the Java application, you will have to package it normally and deploy it to the JBoss EAP instance. Use the following commands:

mvn clean package
cp target/rhdg-on-eap.war $EAP_HOME/standalone/deployments

4.2. Run the client application

Right after copying the .war file, you will be able to access the application on this URL http://127.0.0.1:8080/rhdg-on-eap.

5. Comparison between Data Grid options

This section compiles all the ways you can run a certified Data Grid cluster as a cache and summarizes some of the pros / cons that I found:

  1. Red Hat Data Grid in Client / Server mode

  2. Red Hat Data Grid in Embedded mode

  3. Infinispan subsystem for EAP (RHDG feature integrated with EAP server).

  4. Java application running inside EAP with Data Grid in embedded mode.

Feature

1. DG in C/S mode

2. DG in embedded mode

3. DG subsystem for EAP

4. EAP app with embedded mode

Advanced features

Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc.

Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc.

Con: Reduced capabilities.

Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc.

Coupling and DG upgrades

Pro: Decouples the cache and app lifecycle. Application upgrades don’t force cached data rebalancing. RHDG upgrades don’t impact applications.

Con: Cache and app lifecycle are coupled. Application upgrades force cached data rebalancing and upgrading Data Grid version implies restarting all the application nodes.

Pro: Decouples the cache and app lifecycle. Application upgrades don’t force cached data rebalancing. RHDG version is managed by EAP, not the application. RHDG upgrades don’t impact applications.

Con: Cache and app lifecycle are coupled. Application upgrades force cached data rebalancing and upgrading Data Grid version implies restarting all the application nodes.

Restarts

Pro: App node restarts don’t imply loosing cached data.

Con: App node restarts imply loosing or rebalancing cached data.

Pro: App node restarts don’t imply loosing cached data.

Con: App node restarts imply loosing or rebalancing cached data.

Data Access

Pro: You can use your data from any client application, even non-Java clients.

Con: You can only access data from the same application.

Pro/Con: You can share your caches among all your applications deployed on that EAP cluster, but cannot expose a Hot Rod endpoint to access those caches from outside the EAP cluster.

Con: You can only access data from the same application.

Consumption

Con: More Mem/CPU consumption, as you need to deploy JVMs both for app and Data Grid, and provide sufficient resources to both JVMs to avoid OutOfMemory exceptions.

Con: Less Mem/CPU consumption as you share the JVM for both app and cache.

Con: Less Mem/CPU consumption as you share the JVM for both app and cache.

Con: Less Mem/CPU consumption as you share the JVM for both app and cache.

Subscriptions

Con: All Data Grid servers need Data Grid entitlements.

Pro: All JVMs need Data Grid entitlements.

Con: All EAPs need both EAP and Data Grid entitlements.

Con: All EAPs need both EAP and Data Grid entitlements.

Data Grid version

Pro: Use the latest version as soon as the new version is Generally Available (GA).

Pro: Use the latest version as soon as the new version is Generally Available (GA).

Con: After the new DG version is released, you have to wait for the EAP team to integrate it in EAP. Check here current Data Grid bits version in EAP releases.

Pro: Use the latest version as soon as the new version is Generally Available (GA).

Annex A: Installing EAP modules manually

⚠️
This section is only for EAP version < 7.4.0.GA

To use Data Grid inside applications deployed to Red Hat JBoss EAP, you should install Data Grid modules that:

  • Let you deploy applications without packaging Data Grid JAR files in your WAR or EAR file.

  • Allow you to use a Data Grid version that is independent to the one bundled with Red Hat JBoss EAP.

More detailed information:

rhdg-on-eap's People

Contributors

alvarolop avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.