PL 400 : optimize for performance, concurrency, transactions, and batching (Use platform APIs)

Some factors like performance, concurrency, transactions and batching are important for every business application. These factors can be a barrier to users and interactive applications, so Microsoft implements various mechanisms in the Dataverse web API to increase performance and deal with the various factors. In the article, I will highlight every factor and make an outline.


Dataverse Web API Performance:

  • JSON Serialization:
    • Use JSON instead of XML for exchanging data between service provider, because JSON is light weight.
  • Use OData to query data:
    • OData is time tested language for query RESTful APIs , It improves the performance during CRUD operations against Microsoft Dataverse Data.
  • Use Patch method:
    • Patch methods  provide Upsert capability.
  • Use FetchXML to Query Data: 
    • FetchXML is a robust query language that was developed by Microsoft to enable complex operations to be performed against Microsoft Dataverse Data Web API.
  • Web API requests are subject to the throttling and request limits.

Concurrency:

Concurrency is an essential part of modern programming because it handles multiple users at once and the Dataverse Web API supports concurrency to perform multiple data transformations in parallel. The optimistic concurrency feature gives applications the ability to detect whether table records on the server have changed when applications retrieve records while attempting to update or delete records. Optimistic concurrency is supported on all out-of-box tables with offline sync and enabled for all custom tables.

Transactions:

A transaction is a logical unit of processing in a database that requires one or more database access operations. In relational databases, database transactions should be atomic, consistent, isolated and durable. Microsoft Dataverse is a special type of database that provides business logic, automation, and integration, but works like a transactional database. In the Microsoft Dataverse, a change set is a transactional operation which means that if any one of these operations fails then all completed operations will be roll back.

Batching:

Microsoft Dataverse allows multiple operations to be performed in a single HTTP request by batching. Batch requests provide change sets, meaning a way of bundling operations that can be performed using the Web API, either succeeding or failing as a group. Use a POST request to submit a batch operation that contains multiple requests. A batch request can consist of a GET request and a change set. In order to use the transactional capabilities of batch requests, only those operations that will change the data can be included in the change set. GET requests should not be included in the change set.

--batch_WKQS9Yui9r
Content-Type: application/http
Content-Transfer-Encoding:binary



Comments

Popular posts from this blog

PCF vs. Web Resources: Choosing the Right Extensibility Tool for Dataverse

Is Debt Prosperity or Trap?

Exam PL-400: Microsoft Power Platform Developer