Payara Server's High Availability Architecture: A Quick Technical Overview

Photo of Luqman Saeed by Luqman Saeed

Introduction

In today's business world, competition is fierce and relentless. As a result, maximizing uptime while reducing downtime and its expenses is a top priority. In particular, users now expect applications to deliver consistent performance, regardless of unexpected challenges. Payara Server offers a high availability (HA) architecture that is designed to keep your business operational at all times. This blog post explores the components and configurations needed to create a highly available Payara Server environment, ensuring your applications remain accessible and responsive.

Understanding Payara Server's HA Building Blocks

Payara Server, with its focus on application performance and reliability, offers a comprehensive architecture for achieving high availability. Let's take a look at the building blocks that make this possible.

  • Server Instances: A server instance is a single, independent process running Payara Server within a Java Virtual Machine (JVM). Each instance manages its resources and applications, and you can have multiple instances on a single machine for isolation or to facilitate rolling upgrades.
  • Domains: A domain is a logical grouping of server instances that are managed together. Think of it as an administrative boundary that allows you to configure, deploy and monitor multiple instances as a cohesive unit. Each domain has its configuration, log files and deployment areas to keep everything well organized.
  • Domain Administration Server (DAS): The DAS is the central control point of a domain. Hosting administrative tools like the web console, it handles configuration changes, orchestrates deployments and communicates with all instances within the domain.
  • Clusters: A cluster is a collection of Payara Server instances that work together as a single logical unit. Clusters offer load balancing (distributing incoming requests), failover protection (redirecting traffic if an instance fails), and the ability to scale horizontally by adding more instances.
  • Named Configurations: These are reusable configurations that define the settings for various aspects of Payara Server, such as JVM options, logging levels and connection pools. They provide consistency across instances and simplify management.
  • Session Persistence: This feature ensures user session data isn't lost if a server instance crashes. It stores session data in a repository (memory, Hazelcast, or file) so that another instance can take over the session.

Configuration Roadmap for High Availability

To achieve high availability with Payara Server, it’s recommended to follow a configuration roadmap. This ensures your environment is optimized for resilience and performance. The following are a set of suggested steps to follow in defining such a roadmap.

Define Your Goals

The first step is to clearly define your high availability objectives. What percentage of uptime do you need to guarantee? How quickly should your application recover after a failure? What performance metrics are essential for your users' experience?

Size Your System

Based on those goals, you need to determine the right size for your system. Analyse your network infrastructure, evaluate the hardware resources you have available, and calculate the number of server instances required to handle your expected traffic load while maintaining redundancy.

Installation and Configuration

Once you have a clear plan, you can move on to installing Payara Server and setting up the essential components. This involves creating domains to logically group instances, defining clusters for load balancing and failover, and configuring individual instances within those clusters. You'll also want to configure load balancers to evenly distribute incoming requests.

Session Persistence

To ensure uninterrupted user experiences during failover scenarios, configuring session persistence is crucial. Payara Server offers various options for storing session data, but for high availability, the Hazelcast Data Grid is recommended. It provides distributed in-memory storage and replication, ensuring session data is always accessible, even in the event of failures.

JMS Clustering (Optional)

If your application relies heavily on Java Message Service (JMS) for communications, you can improve its reliability by configuring JMS clusters. By doing so, you can ensure that messages can be reliably delivered even, if a server instance goes down.

Key HA Features

  • Load Balancing: Payara Server's load balancing feature distributes incoming network traffic (HTTP requests, EJB calls, etc.) across multiple instances within a cluster. This ensures no single instance becomes overloaded, maximises resource utilisation, and provides a responsive experience for your users.
  • Failover: In the event of a server instance failure, Payara Server's failover mechanism automatically detects the problem and redirects requests to healthy instances within the cluster. This prevents service interruptions and maintains application availability, even during hardware or software failures.
  • Centralised Management: The Domain Administration Server (DAS) provides a unified point of control for managing your entire domain. You can use the web-based Administration Console or the asadmin command-line tool to configure, deploy, monitor and maintain all your server instances and clusters. This centralised approach simplifies administrative tasks and makes for consistent configurations across your environment.
  • Data Grid (Hazelcast): Payara Server integrates with Hazelcast, a high-performance in-memory data grid. Thanks to this, you can benefit from session replication, which ensures that user session data are safely stored and replicated across multiple instances. If one instance fails, another instance can pick up the session, providing a smooth experience for users. Hazelcast also offers powerful caching capabilities, improving application performance by storing frequently accessed data in memory.

Conclusions

High availability (HA) is essential for modern enterprise applications, and Payara Server offers a powerful set of features to achieve that in your applications. From intelligent load balancing, to seamless failover, centralised management, session persistence through Hazelcast, and the flexibility to adapt to your preferred infrastructure whether on-premise, in the cloud or hybrid.

 Payara Server  Download Here 

If you're looking for a reliable, standards-compliant, and cloud-native platform to ensure your Jakarta EE applications stay online and deliver the best performance, Payara Server is ideal. Don't just take our word for it – explore the official documentation, download Payara Community today, and experience all these HA features first-hand. Happy Coding!

Branding Tagline_Hubspot Banner-2

 

Comments