Future-Proofing Warehouse Logistics Under S/4HANA in Malaysia

The logistics landscape across Malaysia is executing a massive digital shift. Driven by Kuala Lumpur’s booming e-commerce corridors, the expansion of automated distributions hubs in Selangor, and manufacturing expansions in Penang, supply chains are under immense pressure to achieve absolute precision.

For decades, the standard backend engine driving this physical inventory control has been SAP Warehouse Management (SAP WM).

However, enterprise IT leads and logistics directors have arrived at a critical crossroads. The official compatibility timeframe for classic SAP WM has closed. For businesses transitioning their ERP systems to the modern SAP S/4HANA database ecosystem, running legacy WM architecture in its old format is no longer an option.

Organizations face an immediate, strategic baseline choice: migrate full-scale automated hubs to the robust SAP Extended Warehouse Management (SAP EWM) platform, or reconfigure manual storage hubs under the streamlined SAP S/4HANA Stock Room Management framework.

                    ┌─── [Complex/Automated Hubs] ───> SAP Extended Warehouse Management (EWM)

                    │                                   (Advanced Analytics, AI Slotting, Wave Systems)

[Legacy SAP WM] ────┤

                    │

                    └─── [Simple/Manual Warehouses] ──> SAP S/4HANA Stock Room Management (SRM)

                                                        (Core Bin Upkeep, Standard Putaway & Picking)

To prevent disruptive supply chain gaps, Malaysian corporate teams must urgently master these updated technical architectures.

Assessing the Gap: EWM Advanced vs. Stock Room Management

The primary operational challenge for local supply chains is selecting the correct structural path. Many organizations default to treating their database shift as a minor software update, failing to realize that features have been radically altered.

If your company runs simple, manual stockrooms or basic maintenance stores with minimal automation, SAP Stock Room Management (SRM) serves as a stable, low-effort bridging alternative. It retains basic inventory management at the storage bin level, goods receipt matching, and standard picking/putaway protocols.

However, SAP SRM explicitly drops support for advanced legacy components like Task & Resource Management (WM-TRM), Yard Management (WM-YM), and Value-Added Services (WM-VAS).

For modern, multi-tier distribution networks running complex automated conveyors, automated picking lines, or real-time wave strategies, migrating up to SAP EWM Advanced is mandatory. EWM introduces process-oriented storage control, native Material Flow Systems (MFS), and intelligent AI-powered inventory slotting.

Attempting to run these updated environments without specialized training leads to severe data mismatch errors, failed RF scanner transactions on the warehouse floor, and extensive processing backlogs that can compromise client fulfillment timelines.

Earning Baselines: The High Value of Modern SAP Logistics Consultants

Because planning and executing an enterprise supply chain migration requires an intricate hybrid understanding of physical warehouse movements, material tracking configurations, and ABAP database schemas, qualified SAP Logistics professionals are in exceptionally high demand.

Data compiled from B2B industrial technical recruitments across Malaysia highlights the premium earning power commanded by certified logistics specialists:

Core Specialization & ArchitectureAverage Monthly Salary Range (MYR)Enterprise Logistics Business Impact
SAP Logistics / MM Functional ConsultantRM 8,500 – RM 13,000Designing standard storage bin maps, setting up movement parameters, and handling inventory cycle counting scripts.
Lead SAP EWM Enterprise ArchitectRM 15,000 – RM 24,000+Engineering multi-site migration roadmaps, integrating Material Flow hardware, and auditing cross-module data compliance loops.

Securing Fulfillment Continuity via HRD Corp Training Levies

For corporate leadership and Operations Directors, attempting to resolve warehouse management inefficiencies by continuously relying on expensive external implementation agencies is a financially exhausting approach. The most sustainable strategy is to build a highly agile internal center of logistics excellence.

By upskilling your current materials handlers, logistics analysts, and internal IT support teams together through structured, hands-on technical modules, you establish an aligned operational language. Your team learns how to perform system compliance checks, run data cleansing scripts prior to cutover dates, and rapidly resolve RF monitor errors on the live warehouse floor.

Best of all, because these advanced functional tracks are fully recognized under national professional development parameters, Malaysian employers can completely offset their training expenses by leveraging their accumulated corporate levies—turning an administrative requirement into a significant warehouse performance upgrade.

Master Modern Enterprise Supply Chains

Whether you are an ambitious functional consultant ready to master the complexities of SAP EWM to unlock senior enterprise consulting tracks, or an operations manager protecting your facility from unexpected distribution downtime, systematic training is your definitive roadmap.

Lernix provides a comprehensive suite of practical, expert-led training paths engineered specifically to handle real-world supply chain migrations. Review our updated curriculum modules, prerequisites, and flexible corporate enrollment tracks directly on our SAP WM Warehouse Management Training Courses Malaysia page.

Do you need to schedule a dedicated technical class for your logistics division, customize a workflow syllabus to match your industry’s specific storage layout variables, or verify your company’s HRD Corp claim eligibility? Connect directly with our training strategists through the Lernix Course Inquiry Portal to secure your corporate supply chain roadmap today.

Architecting Sovereign Private Clouds via Red Hat OpenStack in Malaysia

The underlying economics of enterprise data center virtualization have been fundamentally disrupted. Following Broadcom’s massive restructuring of VMware’s licensing models—which forced a sudden shift from perpetual licenses to mandatory subscription bundles—enterprises across Malaysia are experiencing severe budget strain.

From Tier-1 banking institutions in Kuala Lumpur to large-scale data center operators across Selangor, infrastructure budgets are surging by 2x to 5x for the exact same hardware footprint.

Consequently, mid-market enterprises, government agencies, and telecom providers are actively orchestrating migration strategies to break free from vendor lock-in.

The definitive open-source architecture leading this migration is Red Hat OpenStack Platform (RHOSP).

                               ┌─── [Legacy Compute Estate] ───> OpenStack Nova (KVM Hypervisors)

                               │

[The VMware Licensing Crunch] ─┼─── [Software Defined Network] ──> OpenStack Neutron (OVN Overlays)

                               │

                               └─── [Enterprise Block Pools] ──> OpenStack Cinder (Ceph Native Storage)

However, migrating legacy hypervisors to an open-source bare-metal cloud platform demands an elite, highly structured set of skills. To prevent operational downtime during migration phases, local engineering units must rapidly shift their mindsets from proprietary graphical panels to automated infrastructure-as-code orchestration.

The New Paradigm: Red Hat OpenStack Services on OpenShift (RHOSO)

The core technical hurdle for local cloud architects is navigating the convergence of traditional virtual machines and modern container engines. Red Hat has completely redesigned its cloud delivery framework, introducing Red Hat OpenStack Services on OpenShift (RHOSO).

In previous architectures, the OpenStack control plane—the engine managing core modules like Nova (Compute), Neutron (Networking), and Cinder (Storage)—was deployed directly onto standard Linux bare-metal operating systems using complex deployment managers.

Under the updated RHOSO blueprint, the entire OpenStack control plane is completely containerized and runs natively as microservices inside Red Hat OpenShift.

┌────────────────────────────────────────────────────────┐

│               Red Hat OpenShift (OCP)                  │  <── Control Plane Orchestration

├───────────────┬────────────────────────┬───────────────┤

│  Nova Pods    │      Neutron Pods      │  Cinder Pods  │  <── OpenStack Microservices

└───────────────┴────────────────────────┴───────────────┘

This structural evolution delivers massive operational advantages:

  • Unified Control Plane: Systems administrators manage traditional monolithic legacy workloads (VMs) and modern microservices through a single platform layer.
  • Automated Lifecycle Management: Kubernetes operators natively handle OpenStack updates, scaling, and self-healing tasks automatically.
  • Declarative Infrastructure: Your entire infrastructure is defined as code, allowing you to deploy multi-node compute clusters using repeatable GitOps workflows.

Attempting to engineer this advanced, unified infrastructure without specialized, hands-on training leads to severe misconfigurations. Unprepared teams frequently struggle with automated Open Virtual Network (OVN) routing setups, miscalculate Ceph storage replication variables, or break underlying control-plane loops—resulting in unstable environments and lost data.

Income Realities: The Premium Value of Certified Cloud Architects

Because orchestrating an open-source, multi-tenant enterprise private cloud requires a rare combination of advanced Linux administration, deep network engineering, and Kubernetes mastery, qualified OpenStack engineers command some of the highest salaries in the Southeast Asian tech industry.

Data gathered from regional enterprise cloud and B2B infrastructure recruitment channels highlights the lucrative compensation trajectory for validated private cloud talent:

Professional Certification & TierAverage Monthly Salary Range (MYR)Enterprise Cloud Infrastructure Impact
Red Hat Certified Specialist in Cloud InfrastructureRM 9,000 – RM 15,000Managing bare-metal hypervisor pools, configuring Neutron network overlays, and securing multi-tenant projects.
Lead Cloud Infrastructure Architect / RHCA (OpenShift/Cloud)RM 18,000 – RM 30,000+Designing hybrid cloud transition maps, implementing RHOSO container-converged control planes, and auditing data sovereignty compliance.

Securing On-Premise Agility via HRD Corp Training Levies

For enterprise CIOs and Infrastructure Heads, attempting to escape proprietary licensing costs by simply throwing software at an untrained IT department is a recipe for project failure. If your internal system engineers do not understand declarative configurations, network overlays, and persistent volume provisioning, your migration will stall. The most reliable approach is to systematically upskill your existing systems team.

By taking your current system administrators, network engineers, and DevOps teams through structured, lab-based technical courses, you cultivate an agile internal platform engineering team. Your staff learns how to run automated deployment playbooks, troubleshoot compute node failures, and optimize hypervisor configurations to achieve maximum performance.

Best of all, because these advanced cloud engineering paths align perfectly with national professional development blueprints, Malaysian employers can completely offset their technical training expenses by leveraging their accumulated corporate levies—turning an administrative requirement into a powerful digital transformation asset.

Command Your Private Cloud Infrastructure

Whether you are an ambitious systems engineer ready to master enterprise open-source cloud architectures to achieve premium certification brackets, or an enterprise leader protecting your organization from unpredictable software licensing fee increases, structured technical training is your definitive roadmap.

Lernix provides a comprehensive ecosystem of practical, expert-led training paths engineered explicitly to tackle the realities of modern enterprise cloud design. Review our core curriculum setups, lab prerequisites, and flexible enterprise scheduling options directly on our Red Hat OpenStack Training Courses Malaysia page.

Do you need to organize a dedicated technical training block for your infrastructure division, customize an engineering syllabus to match your specific multi-tenant data center parameters, or verify your company’s HRD Corp claim eligibility? Connect directly with our training strategists through the Lernix Course Inquiry Portal to anchor your private cloud roadmap today.

Architecting Hardened Infrastructure with RHEL 10 in Malaysia

The benchmark for enterprise data center security across Malaysia has shifted into a zero-trust model. Driven by strict central bank regulations, tightening personal data safety audits, and sophisticated cloud-native threat environments, maintaining basic server uptime is no longer the sole metric of success for operations teams.

At the foundation of this secure, transactional enterprise architecture sits Red Hat Enterprise Linux (RHEL).

However, enterprise systems administration has moved far beyond manually typing bash scripts. With the official closure of extended support for legacy platforms like RHEL 7, and the rapid deployment of the modern RHEL 10 ecosystem across local banking, telecom, and government sectors, the required skillset for infrastructure teams has completely changed.

Organizations can no longer rely on traditional system administrators who run isolated, unrecorded system tweaks. To survive the modern security landscape, companies require certified experts capable of deploying standardized, immutable operating systems and automated deployment blueprints.

[Legacy OS Administration] ───> Manual Core Installs ───> Configuration Drift ───> Security Audit Fails

[Modern RHEL 10 Standard] ───> Image Mode (Containers) ───> GitOps Declarative Code ───> Hardened Compliance

The Vulnerability of Configuration Drift: Manual Tweaks vs. Immutable Image Mode

A persistent operational risk for infrastructure managers across the Klang Valley is Configuration Drift. This happens when multiple engineers log into separate staging and production servers to manually patch packages, adjust local user privileges, or tweak firewall rules without recording their changes in a central script. Over time, these undocumented deviations build up, creating silent software incompatibilities and hidden security gaps that lead to system failures during critical audits.

The modern RHEL 10 ecosystem eliminates this vulnerability by completely altering how the operating system is built, shipped, and managed through Image Mode for Red Hat Enterprise Linux.

Instead of treating the operating system as a separate layer that must be patched manually on a physical box, RHEL 10 allows teams to define and deploy the entire operating system as a standardized container image.

┌────────────────────────────────────────────────────────┐

│               Enterprise Git Repository                │  <── Source Configuration

└───────────────────────────┬────────────────────────────┘

                            ▼

┌────────────────────────────────────────────────────────┐

│               Podman / OCI Container Build             │  <── OS-as-Container Compilation

└───────────────────────────┬────────────────────────────┘

                            ▼

┌────────────────────────────────────────────────────────┐

│        Bare Metal  │  Private Cloud  │  Public Cloud   │  <── Identical Production Nodes

└────────────────────────────────────────────────────────┘

By leveraging this containerized operating system method, your infrastructure achieves critical structural advantages:

  • Elimination of Drift: The operating system boots from an unalterable container file, ensuring that every server instance across your company is completely identical.
  • GitOps-Driven Deployment: System adjustments are written directly into configuration files and pushed through code repositories, creating a transparent, auditable history of all environment changes.
  • Post-Quantum Security Frameworks: RHEL 10 introduces advanced, built-in Federal Information Processing Standards (FIPS) for post-quantum encryption, shielding corporate data assets against long-term cryptographic vulnerabilities.

Transitioning to this container-focused infrastructure architecture requires systematic engineering capability. Without structured, hands-on upskilling, legacy administrators frequently struggle to adapt to immutable file systems, misconfigure network routing profiles inside container loops, or fail to build robust automated deployment playbooks—leaving internal servers exposed to performance bottlenecks.

Compensation Baselines: The High Value of Certified Red Hat Engineers

Because designing and maintaining an automated, hardened bare-metal or hybrid-cloud Linux ecosystem demands an intricate understanding of security compliance, network engineering, and container runtimes, certified Red Hat professionals command premium positions across the regional hiring market.

Data gathered from regional enterprise B2B recruitment directories highlights the premium value assigned to validated systems talent:

Core Professional CertificationAverage Monthly Salary Range (MYR)Enterprise Infrastructure Business Impact
RHCSA (Red Hat Certified System Administrator)RM 6,000 – RM 10,500Configuring secure local storage boundaries, managing network routing profiles, and hardening user access permissions.
RHCE (Red Hat Certified Engineer) / Cloud ArchitectRM 13,000 – RM 22,000+Designing end-to-end automation deployment systems, orchestrating container-converged RHEL 10 image flows, and securing corporate compliance structures.

Securing Operational Resilience via HRD Corp Training Levies

For enterprise technology executives and corporate HR leads, attempting to fix server vulnerabilities and system drift by continuously downloading unverified community patches or depending exclusively on third-party consultants is an expensive approach. The most reliable strategy is to systematically upgrade your internal systems team into an aligned, certified core unit.

By taking your system administrators, network engineers, and security analysts through structured, practical lab training, you build an agile platform engineering squad. Your team learns how to perform in-place upgrades using automated utilities, run real-time diagnostic checks, and manage large-scale deployments without interrupting your daily corporate transactions.

Best of all, because these high-tier engineering paths line up directly with Malaysia’s national digital transformation frameworks, local employers can completely offset their upskilling expenses by leveraging their accumulated corporate levies—turning an administrative compliance asset into a massive cybersecurity shield.

Harden Your Enterprise Infrastructure Architecture

Whether you are an ambitious systems engineer ready to master modern immutable operating system concepts to secure premium global career brackets, or an enterprise leader safeguarding your organization against server vulnerabilities and configuration drift, structured technical training is your definitive roadmap.

Lernix provides a comprehensive suite of practical, expert-led training paths engineered explicitly to handle the realities of modern enterprise Linux engineering. Review our verified curriculum structures, exam criteria, and corporate calendar modules directly on our Red Hat Linux Certification Training Courses Malaysia page.

Do you need to organize a dedicated training block for your system infrastructure division, customize an engineering syllabus to match your proprietary cloud configurations, or verify your company’s HRD Corp claim eligibility? Connect directly with our training specialists through the Lernix Course Inquiry Portal to anchor your corporate infrastructure roadmap today.

Microservices orchestration

Contoso loves the results of using a microservices architecture so far. The overall web application calls individual microservices to provide and manipulate data.

But as more services are added, the overall system becomes more complex to scale out and manage. Orchestrators can help.

What is an orchestrator?

An orchestrator is a tool that helps you manage, scale, and maintain a containerized application.

Using orchestrators for production-ready applications is essential if your application is based on microservices or is split across multiple containers. As noted earlier, in a microservice-based approach, each microservice owns its model and data. The microservice is autonomous from a development and deployment point of view. These kinds of systems are complex to scale out and manage. Therefore, to have a production-ready and scalable multi-container application, you absolutely need an orchestrator.

A cluster is one type of orchestrator. The following diagram illustrates using a cluster to orchestrate the deployment of an application that’s composed of multiple microservices.

Diagram that shows Docker applications in a cluster.

web development

What are microservices?

The cloud drives today’s application development and IT systems management. Modern cloud applications need to be fast, agile, massively scalable, and reliable.

Using containers can help you deploy applications that meet all of those requirements. But putting an application into a container without following a strategic design pattern is like getting into a vehicle and hoping to find your way to a new city without using a map or GPS. You might end up at your destination, but the route probably won’t be direct or the most efficient.

A microservices architecture is useful in this scenario. Microservices give you an approach to software development and deployment that’s perfectly suited to the agility, scalability, and reliability requirements of modern cloud applications.

What is a microservices architecture?

In a microservices architecture, a large application is split up into a set of smaller services. Each service runs in its own process and communicates with other processes by using protocols like HTTP/HTTPS, WebSocket, or Advanced Message Queuing Protocol (AMQP). Each microservice implements a specific, end-to-end domain or business capability within a certain context boundary. Each microservice must be developed autonomously and must be independently deployable. Finally, each microservice should own its related domain data model and domain logic. Microservices can be based on different data storage technologies (SQL, NoSQL) and different programming languages.

Here are some key characteristics of microservices:

  • They’re small, independent, and loosely coupled.
  • Each microservice has a separate code base that a small development team can manage.
  • They’re deployed independently. A team can update an existing microservice without rebuilding and redeploying the entire application.
  • They persist their data or the external state in their respective databases. Unlike in a monolithic architecture, microservices don’t share databases.
  • They communicate with each other by using well-defined APIs. Internal implementation details of each service are hidden from other services.
  • They support polyglot programming. For example, the microservices that make up a web application don’t need to share the same technology stack, libraries, or frameworks.
https://aka.ms/docs/player?id=4c104952-cc11-4995-8de4-5fdc2ccc23bf

Why develop by using a microservices architecture?

Microservices typically encapsulate simpler customer-requirement functionality, which you can scale out or scale in. You can test, deploy, and manage them independently. An important benefit of a microservices approach is that teams are driven more by customer scenarios than by using specific technology. Each small development team develops a microservice based on a customer scenario. The team chooses the technologies it uses.

Microservices provide long-term agility. Microservices support maintainability in complex, large, and highly scalable systems by letting you create applications based on many independently deployable services that each have granular and autonomous lifecycles.

As another benefit, microservices can scale out independently. Instead of having a single, monolithic application that you must scale out as a unit, you can instead scale out specific microservices. You can scale only the functional area that needs more processing power or network bandwidth to support demand instead of scaling out other areas of the application that don’t need to be scaled. That means cost savings because you need less hardware.

Diagram that shows how microservices can scale across virtual machines.

The microservices approach allows agile changes and rapid iteration of each microservice because you can change specific, small areas of complex, large, and scalable applications.

Architecting fine-grained microservices-based applications enables continuous integration and continuous delivery practices. It also accelerates delivery of new functions into the application. You can run and test microservices in isolation and evolve them autonomously, while maintaining clear contracts between services. As long as you don’t change the interfaces or contracts, you can change the internal implementation of any microservice or add new functionality without breaking other microservices.

What role do containers play?

Containerization is an approach to software development in which an application or service, its dependencies, and its configuration (abstracted as deployment manifest files) are packaged together as a container image. You can test the containerized application as a unit, and deploy it as a container image instance on the host operating system.

Software containers act as a standard unit of software deployment that can contain different code and dependencies. This is similar to how shipping containers transport goods of all kinds by ship, train, or truck. Developers and IT professionals can use containerized software to deploy code and dependencies across environments with little or no modification.

If it sounds like containerizing an application might be a great way to implement the microservices architecture pattern, it is. The benefits of using containers line up almost exactly with the benefits of using a microservices architecture.

Diagram that shows multiple containers running on a single host.

 Note

Containerizing an application is not the only way to deploy microservices. You can deploy microservices as individual services in Azure App Service, on virtual machines, or in any number of ways. Containers are the deployment tool that we’ll use for our microservices for the rest of this module.

Another benefit of containerization is scalability. You can scale out quickly by creating new containers to use for short-term tasks. From an application point of view, instantiating an image (creating a container) is similar to instantiating a process like a service or web app.

In short, containers offer the benefits of isolation, portability, agility, scalability, and control across the entire application lifecycle workflow.

The microservices you build in this module will run in a Docker container, published using .NET CLI.

.NET SDK container publishing

In .NET 7, the .NET SDK gained the ability to create container images via the dotnet publish command. The tools do a bunch of inference based on the properties of your project and its outputs. .NET then creates the same image that a Dockerfile would create. It can take as few as two commands to create a new application and publish it as an image:

donetcliCopy

dotnet new webapi
dotnet publish --os linux --arch x64 /t:PublishContainer -c Release

The preceding .NET CLI commands create a new web API and publish the app as a container:

  • Targeting Linux as the OS (–os linux).
  • Specifying an x64 architecture (–arch x64).
  • Using the release configuration (-c Release).

You can control many aspects of the generated container through MSBuild properties. In general, if you can use a command in a Dockerfile to set some configuration, you can do the same via MSBuild.

Why build microservices in .NET?

Starting with .NET Core and continuing to current iterations, .NET is built to be cloud-native first. It runs cross-platform, so your Docker image can be based on a flavor of Linux, and your .NET code still runs. Microsoft has already created .NET images for Docker. Also, .NET is extremely fast. The ASP.NET Kestrel web server routinely outperforms other web servers.

Docker

Docker is an open-source platform that you can use to automate the deployment of applications as portable, self-sufficient containers that can run in the cloud or on-premises. Docker is also the company that promotes and evolves this technology. Docker as an organization works in collaboration with cloud, Linux, and Windows vendors, including Microsoft.

Docker containers can run anywhere: on-premises in the customer’s datacenter, in an external service provider, or in the cloud. Docker image containers can run natively on Linux and Windows.

What is an image?

When a developer uses Docker, they create an app or service. Then they package the app or service and its dependencies in a container image. An image is a static representation of the app or service and its configuration and dependencies.

The image, when it runs, becomes the container. The container is the in-memory instance of an image.

A container image is immutable. After you build an image, the image can’t be changed. Because you can’t change an image, if you need to make changes to the app or service and its dependencies, create a new image. This feature guarantees that the image you use in production is the same image that’s used in development and testing.

What is a Dockerfile?

A Dockerfile is a text file that contains instructions for how to build a Docker image. Dockerfiles are written in a minimal scripting language that’s designed for building and configuring images. Dockerfiles also document the operations that are required to build an image, starting with a base image.

To create a Docker image that contains your application, you typically begin by identifying a base image. Then you add more files and configuration to the base image. The process of identifying a suitable base image usually starts with a search on Docker Hub. You search for a ready-made image that already contains an application framework and all the utilities and tools of a Linux distribution like Ubuntu or Alpine. For example, if you have an ASP.NET application that you want to package into a container, Microsoft publishes an image called mcr.microsoft.com/dotnet/aspnet that already contains the ASP.NET runtime.

You can customize an image by starting a container with a base image, and then make changes to it. Changes usually involve activities like copying files into the container from the local file system and running various tools and utilities to compile code.

A Dockerfile is a set of instructions that create a Docker image that has the exact software that you need in it to run your application, including the application itself.

supply chain

Introduction

In recent years, enterprises are choosing to use microservices instead of monolithic architectures to meet user demand and increase scalability and availability in their large consumer applications.

Suppose that you started a new job as a software developer at the Contoso outdoor equipment company. Business is booming, and so is Contoso’s website that indicates whether items are in stock. That website is a monolith right now, but it’s an ideal candidate for the microservices architecture. A team member refactored the monolith website into an ASP.NET Blazor page application and a .NET web API. Your job is to deploy the services.

In this module, you gain an understanding of the microservices architectural pattern and the problems that it solves. You see how you can use Docker to implement the microservices architectural pattern with an ASP.NET web API.

By the end of this module, you’ll have the foundation to build microservices with .NET, and understand how you can use Docker to implement the microservices architectural pattern.

staff augmentation service

Create cloud-native apps and services with .NET and ASP.NET Core

Create independently deployable, highly scalable, and resilient services using the free and open-source .NET platform.

Prerequisites

  • Familiarity with command-line based applications.
  • Familiarity with basic Docker concepts.
  • Experience writing C# at the beginner level

software development

Implement infrastructure resiliency with Kubernetes

To implement infrastructure-based resiliency, you can use a service mesh. Aside from resiliency without changing code, a service mesh provides traffic management, policy, security, strong identity, and observability. Your app is decoupled from these operational capabilities, which are moved to the infrastructure layer. Architecturally speaking, a service mesh is composed of two components: a control plane and a data plane.

Diagram of a typical service mesh architecture.

The control plane component has many components that support managing the service mesh. The components inventory typically includes:

  • A management interface, which could be a UI or an API.
  • Rules and policy definitions that define how the service mesh should implement specific capabilities.
  • Security management for things like strong identity and certificates for mTLS.
  • Metrics or observability to collect and aggregate metrics and telemetry from the apps.

The data plane component consists of proxies that are transparently injected alongside each service, which is known as the Sidecar pattern. Each proxy is configured to control the network traffic in and out of the pod that contains your service. This configuration allows each proxy to be configured to:

  • Secure traffic via mTLS.
  • Dynamically route traffic.
  • Apply policies to traffic.
  • Collect metrics and tracing information.

Some popular service mesh options for Kubernetes clusters include Linkerd, Istio, and Consul. This module focuses on Linkerd. The following diagram shows interactions between components within the data and control planes:

Diagram of a Linkerd service mesh architecture.

Comparison to code-based approaches

Linkerd’s principal fault-handling strategy comprises retries and timeouts. Because Linkerd has a systemic view of the entire cluster, it can employ resiliency strategies in novel ways. An example is retrying in such a way as to add a maximum of 20 percent additional load on the target service. Linkerd’s metrics-based view allows it to adapt dynamically to cluster conditions in real time. This approach adds another dimension to managing the cluster, but doesn’t add any code.

With a code-based approach, such as with Polly, you:

  • Are required to guess which retry and timeout parameters are appropriate.
  • Focus on a specific HTTP request.

There’s no reasonable way to respond to an infrastructure failure in your app’s code. Consider the hundreds or thousands of requests that are being processed simultaneously. Even a retry with exponential back-off (times request count) can flood a service.

In contrast, infrastructure-based approaches like Linkerd are unaware of app internals. For example, complex database transactions are invisible to Linkerd. Such transactions can be protected from failure with Polly.

In upcoming units, you’ll implement resilience for the coupon service by using Polly and Linkerd.

Implement application resiliency

The resiliency features of .NET are built upon the Polly project and made available through Microsoft.Extensions. You can add a standard resilience strategy that uses sensible defaults by adding a single line of code to your app.

Add resilience to your app

To add resilience to an app built using a microservices architecture, using HTTP requests between individual services, take these steps:

  1. Add the Microsoft.Extensions.Http.Resilience package to your project.
  2. Add a resilience handler to your HttpClient service calls.
  3. Configure the resilience strategy.

Add the NuGet package to your project

Run the following command to add the resiliency NuGet package:

.NET CLICopy

dotnet add package Microsoft.Extensions.Http.Resilience

Running this command from the terminal in the apps project folder will add the package reference to the project file.

Then add the following using statement in your application’s startup class :

C#Copy

using Microsoft.Extensions.Http.Resilience;

Add a resilience strategy

You can now add a standard resilience strategy to your HttpClient service. .NET provides this out-of-the-box configuration combining a number of strategies.

A diagram showing the strategies included in the Standard Resilience Handler. From overall timeout, retry, bulkhead, circuit breaker, and attempt timeout.

The request handler goes through each of these strategies in order form left to right:

  • Total request timeout strategy: This sets a total amount of time that the request can take. You can think of this as setting the upper time limit for all the other strategies.
  • Retry strategy: This strategy controls the options on number of retries, backoff, and jitter. These options can’t exceed the total timeout set in the previous strategy.
  • Circuit breaker strategy: This strategy opens the circuit if the failure ratio exceeds the threshold.
  • Attempt timeout strategy: This strategy sets a timeout for each individual request. If the request takes longer than this time, then an exception is thrown.

You can add this standard strategy, with all the default values by adding this extension method:

C#Copy

.AddStandardResilienceHandler();

For example if you have declared a WebApplication, and you want to add a resilience strategy to the HttpClient service use this code:

C#Copy

builder.Services.AddHttpClient<ServiceBeingCalled>(httpClient =>
{
    httpClient.BaseAddress = new Uri("https://service.endpoint/");
}).AddStandardResilienceHandler();

The first line of the preceding code adds a standard resilience handler to the HTTPClient. This will use all the default settings for the retry and circuit breaker strategies.

Configure the resilience strategy

You can change the default values of any of the strategies by specifying new options, for example:

C#Copy

.AddStandardResilienceHandler( options => 
{  
    options.RetryOptions.RetryCount = 10;
    options.RetryOptions.BaseDelay = TimeSpan.FromSeconds(1);
});

This code changes the retry strategy defaults to have a maximum number of retires of 10, to use a linear back off, and use a base delay of 1 second.

The options you choose have to be compatible with each other. For example, if the total time remains as its default of 30 seconds, then the retry options will cause an exception. This is an error because the exponential backoff setting would cause the total time to complete the 10 retries to be 2,046 seconds. This is a runtime exception, not a compile time error.

The following table lists the options available for each of the strategies.

Total request timeout optionsDescription
TotalTimeoutThe total amount of time that the request can take. The default is 30 seconds.
OnTimeoutA callback function that’s invoked when the request times out. The default is null.

Retry optionsDescription
RetryCountThe maximum number of retries. The default is 3.
BackoffTypeThe type of backoff to use. You can choose between linear and exponential. The default is exponential.
UseJitterWhether to add jitter to the backoff. Jitter adds randomness to the delay to help reduce spikes in load. The default is true.
BaseDelayThe delay between retries. The default is 2 seconds.

Circuit breaker optionsDescription
BreakDurationThe duration of the circuit break. The default is 5 seconds.
FailureRatioThe ratio of failed requests to successful requests that will open the circuit. The default is 0.1.
SamplingDurationThe duration of time that the failure ratio is calculated over. The default is 30 seconds.
OnClosedA callback function that’s invoked when the circuit is closed. The default is null.
OnHalfOpenedA callback function that’s invoked when the circuit is half-open. The default is null.
OnOpenedA callback function that’s invoked when the circuit is opened. The default is null.

Attempt timeout optionsDescription
TimeoutThe amount of time that the request can take. The default is 2 seconds.
OnTimeoutA callback function that’s invoked when the request times out. The default is null.

A sequence diagram showing the flow of events in an application using a resiliency strategy.

The sequence diagram shows how each of the strategies work together in a standard resiliency strategy. To begin with, the total timeout strategy controls the limiting factor of how long a request can take. The retry strategy must then be set to have a maximum number of retries that will complete within the total timeout. The circuit breaker strategy will open the circuit if the failure ratio exceeds the threshold set for it. The attempt timeout strategy sets a timeout for each individual request. If the request takes longer than this time, then an exception is thrown.

software development

Application and infrastructure resiliency

Resiliency is the ability to recover from transient failures. The app’s recovery strategy restores normal function with minimal user impact. Failures can happen in cloud environments, and your app should respond in a way that minimizes downtime and data loss. In an ideal situation, your app handles failures gracefully without the user ever knowing there was a problem.

Because microservice environments can be volatile, design your apps to expect and handle partial failures. A partial failure, for example, can include code exceptions, network outages, unresponsive server processes, or hardware failures. Even planned activities, such as moving containers to a different node within a Kubernetes cluster, can cause a transient failure.

Resiliency approaches

In designing resilient applications, you often have to choose between failing fast and graceful degradation. Failing fast means the application will immediately throw an error or exception when something goes wrong, rather than try to recover or work around the problem. This allows issues to be identified and fixed quickly. Graceful degradation means the application will try to keep operating in a limited capacity even when some component fails.

In cloud-native applications, it’s important for services to handle failures gracefully rather than fail fast. Since microservices are decentralized and independently deployable, partial failures are expected. Failing fast would allow a failure in one service to quickly take down dependent services, which reduce overall system resiliency. Instead, microservices should be coded to anticipate and tolerate both internal and external service failures. This graceful degradation allows the overall system to continue operating even if some services are disrupted. Critical user-facing functions can be sustained, avoiding a complete outage. Graceful failure also allows disturbed services time to recover or self-heal before impacting the rest of the system. So for microservices-based applications, graceful degradation better aligns with resiliency best practices like fault isolation and rapid recovery. It prevents local incidents from cascading across the system.

There are two fundamental approaches to support a graceful degradation with resiliency: application and infrastructure. Each approach has benefits and drawbacks. Both approaches can be appropriate depending on the situation. This module explains how to implement both code-based and infrastructure-based resiliency.

Code-based resiliency

To implement code-based resiliency, .NET has an extension library for resilience and transient failure handling, Microsoft.Extensions.Http.Resilience.

It uses a fluent, easy-to-understand syntax to build failure-handling code in a thread-safe manner. There are several resilience policies that define failure-handling behavior. In this module, you apply the Retry and Circuit Breaker strategies to HTTP client operations.

Retry strategy

Retry strategy is exactly what the name implies. The request is retried after a short wait if an error response is received. The wait time increases with each retry. The increase can be linear or exponential.

After the maximum number of retries is reached, the strategy gives up and throws an exception. From the user’s perspective, the app usually takes longer to complete some operations. The app might also take some time before informing the user that it couldn’t complete the operation.

Circuit Breaker strategy

Circuit Breaker strategy gives a target service a break after a repeated number of failures by pausing trying to communicate with it. The service could be experiencing a serious problem and be temporarily unable to respond. After a defined number of consecutive failures, the connection attempts are paused, opening the circuit. During this wait, additional operations on the target service fail immediately without even trying to connect the service. After the wait time has elapsed, the operation is attempted again. If the service successfully responds, the circuit is closed and the system goes back to normal.

Infrastructure-based resiliency

To implement infrastructure-based resiliency, you can use a service mesh. Aside from resiliency without changing code, a service mesh provides traffic management, policy, security, strong identity, and observability. Your app is decoupled from these operational capabilities, which are moved to the infrastructure layer.

Comparison to code-based approaches

An infrastructure-based resiliency approach can use a metrics-based view that allows it to adapt dynamically to cluster conditions in real time. This approach adds another dimension to managing the cluster but doesn’t add any code.

With a code-based approach you:

  • Are required to guess which retry and timeout parameters are appropriate.
  • Focus on a specific HTTP request.

There’s no reasonable way to respond to an infrastructure failure in your app’s code. Consider the hundreds or thousands of requests that are being processed simultaneously. Even a retry with exponential back-off (times request count) can flood a service.

In contrast, infrastructure-based approaches are unaware of app internals. For example, complex database transactions are invisible to service meshes. Such transactions can only be protected from failure with a code based approach.

In upcoming units, you’ll implement resilience for a microservice based app using .NET HTTP resiliency in code and a Linkerd service mesh.

school management