Resiliency

Resiliency

Resiliency is the ability to recover from disruptions to critical processes and supporting technology systems. This includes anything from hardware or software issues to network outages or data center failures. A resilient Nexus Repository implementation is designed to minimize downtime.

This involves redundancy, failover mechanisms, and robust data management strategies to protect against data loss and service interruptions.

Choosing the appropriate resiliency options is your primary goal when designing your Nexus Repository architecture.

See Migrating to a Resilient Deployment documentation for details.

Resiliency Terminology

Understanding the specific terminology used is crucial for understanding the guidance recommended in this section. Here's a breakdown of the key terms:

Backups should include documenting the service environment and the system configuration, as well as the application binaries, blob stores, and database. You may want different schedules or priorities depending on the frequency of deployments and audit requirements.

Recommendations for Resiliency

Resiliency involves balancing three outcomes; the costs of your maintenance plan, with the time needed to recover, against the risks of disruptions to the service. The following best practices are tools for improving the resiliency of your Nexus Repository.

Failure Scenarios and Recovery

This section provides a breakdown of potential failure scenarios for Nexus Repository in both single-node and clustered environments. The scope of interruption you need to mitigate balanced with the cost of ownership for those deployments determines which architecture is needed to achieve your required level of resiliency.

Single Node Failure

This encompasses failures of the physical or virtual server hosting Nexus Repository. Hardware failures include hard drive crashes, memory issues, or power supply problems. Software failures can involve operating system crashes, application bugs, or dependency conflicts.

Loss of service for artifacts hosted on the failed node. Builds dependent on those artifacts will fail.

Restore the Nexus Repository data and configuration from the most recent backup. The backup should include the application files, database, and any custom configurations.

The cluster should automatically detect the node failure and initiate failover to a healthy, available node. Repair or replace the failed node and rejoin it to the cluster.

Data Center or Zone Outages

A data center or zone outage refers to a significant outage affecting an entire data center or a large portion of its infrastructure. This could be caused by natural disasters (e.g., floods, fires, earthquakes), widespread power outages, or major infrastructure problems.

Develop a comprehensive disaster recovery plan that includes procedures for data backup and restoration, infrastructure recovery, application deployment, and failback.

Network Connectivity Issues

Problems with the network infrastructure, such as switch failures, router misconfigurations, or network outages, can disrupt communication between Nexus Repository nodes (in a cluster) or between clients and the repository.

High latency between remote proxy nodes may cause long download times and build failures.

Database Failure

This refers to failures of the database used by Nexus Repository to store artifact metadata and server configuration. Database failures can be caused by hardware problems, software bugs, high latency, and data corruption.

A database failure typically leads to a complete Nexus Repository outage. When restoring a backup, there will be inconsistencies between the database and the artifacts in the blob stores that must be reconciled.

Restore the database from the most recent, valid backup. After restoring the database, verify its integrity to ensure no data corruption occurred during the backup or restore process.

Under support supervision, use the repair and reconcile task to resolve inconsistencies between the database and blob stores.

Disk Failure

Failure of the hard drives or storage volumes where Nexus Repository is installed or where its data is stored. The impact depends on which disks fail. A failure of the OS disk may bring down the server. A failure of a blob store disk could lead to loss of the artifact data on that disk.

Use a dynamic failover instance to improve recovery time.

Object storage replication is used to maintain copies of artifacts across different storage locations in other data centers or even across different geographical regions. Using the object storage failover configuration, Nexus Repository automatically switches to a new location in case of unavailability or failure.

Data Corruption

Data corruption refers to situations where the data stored within Nexus Repository becomes damaged or inconsistent. This can be caused by software bugs, hardware issues, or improper shutdowns.

The impact varies depending on the extent of the corruption. It might affect a few artifacts, a specific repository, or the entire repository.

Restore the affected artifacts from backups. In some cases, it might be necessary to rebuild repository metadata if it has become significantly corrupted.

Security Breach

A security breach occurs when unauthorized individuals gain access to the Nexus Repository system or its data. This can be due to compromised credentials, software vulnerabilities, or misconfigurations.

Reset all passwords and revoke any compromised credentials. Consider restoring the Nexus Repository from clean backups if the system has been significantly compromised.

Keeping Nexus Repository on the latest version ensures you have the latest security fixes.

Use the principle of least privileges when designing your access controls to limit future exposure.

Library of Patterns

The sections below list various patterns to use depending on your resiliency requirements.

Single Node with Backup

Single active node with a cold backup that can be used to recover from a data loss.

Supported with Community Edition (CE)

Examples:

Backup and Restore

Backup and Restore in Amazon Web Services

Single Node with Dynamic Failover

A single active node in one availability zone. Should a node or availability zone fail, Kubernetes activates a second node in either the same or a second availability zone.

Nexus Repository Pro Deployments

Azure - single node

GCP - single node

Community Edition (CE) Deployments

These models are compatible with the Community Edition. The included Helm charts are only available for Pro deployments, however they may be manually adjusted for CE deployments.

On-premises: single node with Kubernetes

AWS - single node

Active-Active Node Clustering

A cluster of redundant active Nexus Repository instances within a single region or on-premises data center. The number of instances may be manually scaled or leverage Kubernetes to automatically scale instances.

Examples

High Availability Deployment