Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

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 Enterprise Linux for Edge

Share:

    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

    • How to deploy EVPN in OpenStack Services on OpenShift

    • Ollama or vLLM? How to choose the right LLM serving tool for your use case

    • How to build a Model-as-a-Service platform

    • How Quarkus works with OpenTelemetry on OpenShift

    • Our top 10 articles of 2025 (so far)

    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

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    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
    © 2025 Red Hat

    Red Hat legal and privacy links

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

    Report a website issue