Optimize data entities to achieve better performance

Completed

When you are implementing data entities, performance is a major factor. The architecture of your entities is key when it comes to performance.

You should create an entity that provides a holistic object that encapsulates the business logic in one single consumable contract. As previously mentioned, the data entity is then used to expose data through APIs like OData, import/export framework, integration, and the programming model. As a developer, you should consider several factors to ensure that your data entity is designed in a way that promotes performance and easy maintenance.

Entity encapsulation

  • Your entities should provide an abstraction between the actual data model and the consumer of the entity. For example, the data entity should encapsulate the underlying tables that all together define the entity.

  • Your entities should encapsulate multiple related tables to represent the object. There might be cases where a single table is used.

Have one single public contract

  • The public contract for your data entity should be the same across all integration endpoints. This allows for consistency for the published schema, regardless of the mechanism for consumer interaction.

  • When an entity is consumed, the business logic that's performed within the entity during CRUD operations should not vary based on the type of consumer.

Keep your entity simple

  • The entity consumer should be able to interact with an entity based on the accepted industry or domain definitions. The behavior details of the entity should be kept hidden and should be prevented from distorting the interaction.

  • The consumer of the entity should be able to interact with the entity by using the natural key of the entity.