Tips for solving big data model problems in Entity Framework

Source: Internet
Author: User

Srikanth manadi, development leader of Entity Framework, saidArticleTo solve the big data model problems in Entity Framework, but it clearly means "using some tips" to solve these problems. This article first talks about the expected number of entities between 50 and 100 for any application. Beyond this range, the editor cannot be used.

Entity Framework has some serious performance problems. For example, every time a new connection string is used, XML-based metadata for the entire data model is loaded into the memory. If you have small applications that share common data models, adding new entities to any of them will slow down all applications. In essence, this restriction makes it impossible for us to put the Entity Framework data model into the shared library.

Generating a view is another failure of Entity Framework Design. Srikanth manadi explains:

This process starts when a query or savechanges occurs for the first time. The performance of the view generation step depends not only on the model size, but also on the relationship between the models. If two entities are connected through an inheritance chain or association, we call them connected. Similarly, if two tables are connected by a foreign key, we also call them connected. As the number of tables connected to the object and schema increases, the cost of view generation increases.

To solve these problems, Srikanth manadi recommends dividing big data models into Small subsets. There are two ways to do this, but they don't feel very good.

The first is to use a completely independent subset. If two or more subsets require a table, create independent entities for them. In this way, direct calls across subsets cannot be implemented, and the entity may be overly expanded.

Another way is to "use" the syntax in schema. IDE does not support this. We need to manually edit the XML to indicate that the database needs to use entities in another data model. In addition to the pain of manually editing XML, it can only create one-way connections. If data model A uses an entity in Data Model B, the latter cannot reference the former.

You can read the first and second sections of this article on the blog of the ADO. Net team.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.