Posts

Showing posts from February, 2024

Use Database Access Intent List to Boost Performance in Business Central

Image
Introduction For any Business Application, database replication is a necessity for the application to be highly available, fault tolerant and performant without any data throughput issues. Business Central too follows the database replication utilizing a technique known as "Read Scale Out" or "Leader/Follower or Master/Slave Replication Architecture". Basically, the business operations(Codeunits, Pages, POST/PUT/DELETE API calls) which create the data in the system are relatively quick as compared to Analytical operations (Reports, Queries, GET APIs calls)which read a whole bunch of data from a lot of tables at once. So, in this case, performing both business and analytical operations on the same database can cause performance issues as tables can be locked by an analytical operation while a business operation tries or access or modify that data. A solution for this is using multiple copies of the database in a leader follower architecture. All the write transaction

What is "Database Wait Statistics" in Business Central?

Image
 Introduction: “Wait” typically refers to the amount of time during which a database session waits for an event to complete before it can proceed with execution. Waits can arise for many reasons in a database system, and understanding them is important for  tuning and optimizing performance. References: Database Wait Statistics - Microsoft Docs SQL Server, Wait Statistics object sys.query_store_wait_stats (Transact-SQL) sys.dm_db_wait_stats (Azure SQL Database) sys.dm_os_wait_stats (Transact-SQL) Explanation: Waits, in SQL, are broadly categorized into three categories: Resource Waits : These happen when a worker needs access to a resource like data or system resources, but it's not available because another worker is using it. Examples include waiting for locks, system latches, or for data to be read from the network or disk. Queue Waits :  Occur when a worker is waiting for a task to be assigned to it. Think of it like waiting in line for a job to do. This commonly occurs with sy

Using Notifications in Business Central via AL

Image
Introduction Notifications in Business Central are alerts that appears in the Notification bar based on User actions. Notifications stack up from top to bottom, lasting until the user dismisses them, including those from sub-pages.  Validation errors are prioritized and shown before other notifications. We can use this to alert the user regarding something without taking all the user's notification towards it, in the way messages or errors do. They also have the option to allow Users to make a corrective action by embedding the action button directly into the notification. Let's see how it works. Source Code Pre-requisites Business Central OnPrem/Cloud. References Notification - Business Central Docs Configuration Here, for an example, I've created one simple page which takes two inputs. 1. The message that is to be shown in the notification. 2. The message to be shown after the User clicks on the action embedded in the notification.     And I have two actions which I'l