My previous blog post discussed the benefits of using the read-only replica database. You can read it here. I want to share a little bit more about the new option available with Business Central APIs.
Microsoft’s dynamics 365 Business Central Wave 2 release (version 19) onwards allows you to specify the Data Access Intent directly in the API call. My suggestion is to use it as much as possible. It will improve the performance of the live system.
When you make an API request with “Data-Access-Intent” set in the Header, the value on the DataAccessIntent property defined on the object is ignored, which means the API request header property will decide if it should read from the live database or the replica.
What about the “Database Access Intent” list page settings? Settings species in the “Database Access Intent” list page get priority over the value specified in the API call.
What would happen if you make a POST or any data modification request? Let’s try to make a POST request while we have the “Data-Access-Intent” set to ReadOnly in the Header. As you noticed, the request was returned with an error.
Thank you and Regards,
Tharanga Chandrasekara