Methodology for Performance Risk Management in Business Central Implementation Projects

5 minute read

In the constantly evolving world of ERP systems, ensuring optimal performance during the implementation of Business Central is a crucial challenge, especially in large-scale projects with a significant number of users. Performance directly impacts the efficiency of business processes, and this risk is amplified when Business Central is customized.

Are you a Business Central Project Manager or a Solution Architect? I will try to offer solutions to problems you might encounter with your clients or internally as a responsible party.

My experience at Cosmo Consult and the various situations I’ve encountered have led me to develop a four-part method that provides significant gains in terms of workload, risks, non-regressions, anticipation, and impacts on project teams. At each step, I explain the impact on intrinsic performance.

This article details this method to secure performance during each phase of an implementation project.

The method comprises several steps:

  1. Setting up infrastructure to automatically launch performance tests.
  2. Monitoring the development phase with a set of standard tests.
  3. Developing performance tests representative of the future activity of the company on Business Central.
  4. Final performance tests to validate the solution.

Setting Up Infrastructure to Automatically Launch Performance Tests

Launching performance tests on a Business Central sandbox can be easily automated with an Azure DevOps pipeline. Below is the principle diagram: Infrastructure

Below is an example of yaml code on a DevOps pipeline:

trigger: none
schedules:
- cron: "0 1 * * *"
  displayName: Daily midnight build
  branches:
    include:
    - master
  always: true

variables:
  - group: 'PerformanceTestingAutomate'
jobs:
- job: RunPerformance
  pool:
    vmImage: 'windows-latest'
  steps:
  - task: PowerShell@2
    displayName: 'Run Performance Test on Target Sandbox "$(SandboxName)"'
    inputs:
      targetType: filePath
      filePath: $(System.DefaultWorkingDirectory)/RunBCPTTests.ps1
      arguments: '-Environment "$(Environment)" -AuthorizationType "$(AuthorizationType)" -Credential ([PSCredential]::new("$(Username)", (ConvertTo-SecureString -String "$(Password)" -AsPlainText -Force))) -SandboxName "$(SandboxName)" -TestRunnerPage "$(TestRunnerPage)" -SuiteCode "$(SuiteCode)" -BCPTTestRunnerInternalFolderPath $(System.DefaultWorkingDirectory)/"$(BCPTTestRunnerInternalFolderPath)" -ClientId "$(ClientId)"'

Definition of variables:

Name Definition
Environment PROD for BC online, otherwise OnPrem
AuthorizationType Type of authorization used to connect to BC
Username Business Central User
Password Password of the Business Central User
SandboxName Name of the sandbox to use
SuiteCode Performance test suite to launch
BCPTTestRunnerInternalFolderPath Folder containing the BCPT scripts in your repo
ClientId ClientId of the app set up on AD

It is also possible to conduct performance tests using Al-Go.

The benefit of setting up automation is that tests are conducted regularly without manual intervention.

Monitoring During the Development Phase

In this phase, the primary objective is to detect performance degradations due to the implementation of specific developments on Business Central. The principle is to use the BCPT performance testing tool provided by Microsoft to conduct tests weekly or even daily. Periodically, the test scenarios provided with the BCPT tool are launched on test environments. Regular analysis of the results is performed to determine if the developments have an impact on performance. If significant performance impacts are detected, it’s preferable to make adjustments immediately.

Below is an example of results using BCPT logs extracted to Excel: Infrastructure

In this example, you can see increases in SQL query volumes in certain scenarios that required adjustments.

Recently, it has also become possible to perform this type of analysis directly in the PowerBi reports provided by Microsoft for telemetry analysis. Infrastructure Source

Simultaneously, it’s necessary to start identifying performance scenarios that could represent the real activity of users on Business Central and the anticipated volumes. (Example: number of customers, volume of the order book, number of shipments, and invoices recorded per day). At the end of this analysis, the characteristics of the target system are identified. Examples below (not exhaustive):

Data Type Volumes
Customer 10000
Sales Order Header 20000
Sales Line 400000
Process Number of Parallel Users
Entering customer requests of 10 lines with random item types 30
Calculating the contents of sales requests Once every 5 minutes
Converting sales requests into orders and creating corresponding warehouse shipments 30
Executing shipping processes 20
Importing sales orders Once every 5 minutes

At the end of the development phase, we have a set of developments representative of the target system and an automated test framework to test these developments (a preferable practice). These automated tests can serve as a basis for developing performance tests. Indeed, performance tests are very similar to unit tests that can be developed to automatically validate the functioning of a development. At this stage, it is possible to start developing the final performance tests.

Development of Performance Tests

Based on the defined performance scenarios, the team develops codeunits to execute the target scenarios on Business Central. It may also be necessary to develop processes to generate the volume of data necessary for the execution of performance tests. Indeed, an order book with 5 lines is not the same as an order book with 200,000 lines in terms of performance. This type of volume has an impact. As I mentioned earlier, performance tests are very close to unit tests. Consequently, it is very likely that you will need the test libraries provided by Microsoft. Unfortunately, as of writing this article, it is not possible to install standard test libraries on a Business Central sandbox. The solution is to put the libraries necessary for performance tests in the object range 50000..99999.

Execution of Final Performance Tests

Once the performance tests are developed and the target data volumes are present on Business Central, you can launch the performance tests. These tests allow you to validate the entire solution within the defined scope by simulating user activities for 30 to 60 minutes. These tests enable you to measure the performance of business flows and possible deadlock scenarios without needing to mobilize all users. Below are some examples of results showing the volumes of deadlock found and execution times:

Infrastructure

Infrastructure

These results can serve as a basis for optimizing specific processes developed on Business Central before its implementation, thus avoiding the urgency and stress of performance issues in a production environment.

Conclusion

This methodology, by leveraging modern tools, minimizes manual testing and risks during the final deployment of Business Central. It ensures a secure and efficient implementation, essential in today’s dynamic environment. Moreover, it allows action on three essential axes:

  • Planet: Technical optimization of systems for less CO2 consumption.
  • People: Project organization allowing performance issues to be addressed in advance without stress for the teams.
  • Profit: Ensuring functional business flows to support the company’s activity.

Below is an illustration of this methodology in parallel with a Business Central implementation plan. Infrastructure

Leave a comment