Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

A 3-tier application architecture on Red Hat Device Edge

Blending tradition and modernity: A hybrid approach to edge management

November 26, 2024
Kalyanaraman Narayanan
Related topics:
Edge computing
Related products:
Red Hat build of MicroshiftRed Hat Device Edge

    The Red Hat build of MicroShift and a database are installed on Red Hat Enterprise Linux (RHEL) on an edge server. The presentation and application layers are deployed as containers within the Red Hat build of MicroShift, while the database resides on the base operating system. Figure 1 depicts this.

    MicroShift and Database on Red Hat Enterprise Linux
    Figure 1: 3-tier architecture with Red Hat Device Edge.

    Technical approach

    1. Install and configure Red Hat build of MicroShift: Deploy and set up Red Hat build of MicroShift on the Red Hat Enterprise Linux installed on an edge server.
    2. Install and configure database: Install and configure a database, such as MySQL. Note that any database certified for Red Hat Enterprise Linux can be used.
    3. Create database, import data, and grant access: Create a database, import necessary data, and provide appropriate access privileges to the application user.
    4. Deploy presentation and application containers: Create and deploy containers for the presentation and application layers within MicroShift.

    Benefits

    The benefits of this approach include flexibility, isolation, and efficiency.

    1. Flexibility:

      • Independent updates: The application and presentation layers can be updated and modified independently without affecting the database layer, ensuring flexibility and agility in development and maintenance.

      • Technology choice: The choice of database technology is not constrained, allowing for the selection of the most suitable database for the specific application requirements.

    2. Isolation:

      • Security: Containers provide isolation between the application and presentation layers.

      • Resource management: Each container has its own isolated environment, allowing for efficient resource allocation and management.

    3. Efficiency:

      • Lightweight: MicroShift, as a lightweight container orchestration platform, is well-suited for edge environments, minimizing overhead and maximizing resource utilization.

      • Optimized resource allocation: The base operating system can be optimized for database performance, while the containerized layers can be tailored for specific application requirements.

    Install and configure the Red Hat build of MicroShift

    1. Follow the Procedure to Install Red Hat build of MicroShift from an RPM package.

    1. As a root user, start the MicroShift service by entering the following command:
      $ sudo systemctl start microshift
    2. To configure your RHEL machine to start MicroShift when your machine starts, enter the following command:

      $ sudo systemctl enable microshift
    3. Follow the Procedure to Access the MicroShift cluster.

    Install and configure database

    Follow the Procedure to install MySQL on RHEL.

    Create database, import data, and grant access

    Follow the steps below:

    1. Download the database files from Git and move those to /var/lib/mysql-files.
    2. Log in to MySQL database with credentials created in mysql_secure_installation and create the database qod:
      mysql> create database qod;
    1. Create the application user and grant privileges to qod database:

    Note: 10.42.0.0/16 is the subnet of pod network in Red Hat build of MicroShift cluster. Since this IP address is expected to change with every pod, privilege is granted for entire subnet.

    mysql>create user 'appuser'@'10.42.0.0/16' identified with mysql_native_password by 'Appuser@1';
        mysql> grant all privileges on qod.* to 'appuser'@'10.42.0.0/16' ;
    1. Load the data in qod database:

      mysql> source /var/lib/mysql-files/1_createdb.sql
          mysql> source /var/lib/mysql-files/2_authors.sql
          mysql> source /var/lib/mysql-files/3_genres.sql
          mysql> source /var/lib/mysql-files/4_quotes.sql

    Deploy presentation and application containers

    1. Download the resource definition files from microshift-qod.
    2. Edit the qod-db-credentials file and update the DB_HOST with base64 encoded hostname of your RHEL where the MySQL is installed and configured:

       $ hostname | base64

    Example:

    [root microshift-qod]# cat qod-db-credentials
        kind: Secret
        apiVersion: v1
        metadata:
          name: qod-db-credentials
        data:
          DB_HOST: bXlzcWwtdm0=
          DB_PASS: QXBwdXNlckAx
          DB_USER: YXBwdXNlcg==
        type: Opaque
        [root microshift-qod]#
    1. Create a namespace qod in the MicroShift cluster:

      $ oc create namespace qod

    Optional: Switch to namespace qod:

    $ oc config set-context --current --namespace=qod

    Optional: Set alias for oc config set-context --current --namespace:

    $ alias oc-project='oc config set-context --current --namespace'
    1. Deploy the Presentation and Application tiers on MicroShift in qod namespace with Kustomize:

      $ oc apply -k ./microshift-qod -n qod
    2. Check the status of the applications deployed:

      $ oc get all -n qod

    The following example illustrates the kind of output you should expect:

    $ oc get all -n qod
        NAME                        READY   STATUS  RESTARTS   AGE
        pod/qod-api-5d6bf8b5fc-88m6q   1/1  Running   0         6m32s
        pod/qod-web-79cf4c949b-fz2hq   1/1  Running   0         6m32s
        NAME            TYPE        CLUSTER-IP  EXTERNAL-IP   PORT(S)   AGE
        service/qod-api   ClusterIP   10.43.52.46   <none>        8080/TCP   6m32s
        service/qod-web   ClusterIP   10.43.31.180   <none>       8080/TCP   6m32s
        NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
        deployment.apps/qod-api   1/1   1           1           6m32s
        deployment.apps/qod-web   1/1   1           1           6m32s
        NAME                                DESIRED   CURRENT   READY   AGE
        replicaset.apps/qod-api-5d6bf8b5fc   1      1       1       6m32s
        replicaset.apps/qod-web-79cf4c949b   1      1       1       6m32s
        $

    Open the web browser in the Red Hat Linux host and key in qod-web service IP address with port 8080 to test the 3-tier application deployed. In the above example, IP address of qod-web service is 10.43.31.180. You should see output similar to what is shown in Figure 2.

    Quote of the day from three-tier application in Red Hat Edge
    Quote of the day from three-tier application in Red Hat Edge
    Figure 2: Quote of the day from 3-tier application in Red Hat Device Edge.

    Optional: To check the application from command line, run the following code:

    $ curl 10.43.31.180:8080/random | grep '<i>'

    The following example illustrates the kind of output you should expect:

    $ curl 10.43.31.180:8080/random | grep '<i>'
          % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
        100  1144  100  1144    0     0  44000      0 --:--:-- --:--:-- --:--:-- 44000
                  <i>So long as the memory of certain beloved friends lives in my heart, I shall say that life is good.</i>

    Conclusion

    The 3-tier architecture, coupled with Red Hat Device Edge, provides flexibility and isolation for deploying and managing edge applications. 

    The following use cases demonstrate the versatility of the 3-tier architecture in edge computing, enabling a wide range of applications that require low latency, high performance, and real-time processing capabilities.

    1. Edge analytics:

      • Real-time data processing: Analyzing large volumes of data generated at the edge to extract valuable insights and make timely decisions.

      • Machine learning: Training and deploying machine learning models at the edge for tasks such as predictive maintenance, anomaly detection, and object recognition.

    2. Content delivery networks (CDNs)

      • Caching content: Storing frequently accessed content closer to end-users to reduce latency and improve performance.

      • Dynamic content generation: Generating customized content based on user location, preferences, and device characteristics.

    3. Edge gaming:

      • Low-latency gaming: Providing immersive gaming experiences with minimal lag by processing game logic and rendering graphics closer to the player.

      • Multiplayer gaming: Enabling real-time multiplayer interactions with reduced network latency.

    4. Augmented and virtual reality:

      • Real-time rendering: Processing and rendering complex 3D graphics and environments at the edge for immersive AR/VR experiences.

      • Interactive content: Enabling interactive content and experiences that respond to user inputs in real time.

    5. Edge robotics:

      • Autonomous systems: Controlling and coordinating autonomous robots and drones for tasks such as inspection, delivery, and surveillance.

      • Real-time decision-making: Enabling robots to make quick decisions based on local data and environmental conditions.

    Related Posts

    • Deliver your applications to edge and IoT devices in rootless containers

    • Build and manage Red Hat Device Edge images with Ansible

    • IoT edge development and deployment with containers through OpenShift: Part 1

    • Edge computing: From 30 tons to 30 grams

    Recent Posts

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    What’s up next?

    Discover how edge computing and automation can help your organization improve scalability, security, agility, and overall efficiency. Automation at the edge illustrates the benefits of edge automation in seven industry use cases.

    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.