efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Announcing the Plan for EF Core 6.0 (Updated)

Open ajcvickers opened this issue 5 years ago • 59 comments

May update

In January we announced the plan for EF Core 6.0. Since then we have learned more and gathered more data from customers. These inputs have lead to some updates to the plan. This includes punting some smaller enhancements to the next release, as well as scoping of some the bigger items.

Scoped into 6.0:

The most notable changes scoped into EF Core 6.0 are:

The most notable changes scoped out of EF Core 6.0 are:

  • We have improved test infrastructure and added new tests to support the work done for EF Core 6. Additional improvements in this area have been scoped out of the EF Core 6.0 release.
  • Migrations bundles are still in the plan, but most of the other Migrations features have been cut due to resource constraints.
  • Raw SQL queries for primitive and unmapped types has been cut from 6.0 due to resourcing constraints and priority adjustments.
  • The following miscellaneous issues were cut from the 6.0 release due to resource constraints:

Original post

Today we are excited to share with you the plan for Entity Framework Core 6.0. This issue contains a quick summary of the plan and acts as a place for you to leave feedback.

This plan brings together input from many stakeholders and outlines where and how we intend to invest for the Entity Framework (EF Core) 6.0 release.

This plan is not set-in-stone and will evolve as we work on the release based on what we learn. This learning includes feedback from people like you, so please let us know what you think!

IMPORTANT This plan is not a commitment. It is a starting point that will evolve as we learn more. Some things not currently planned for 6.0 may get pulled in. Some things currently planned for 6.0 may get punted out.

General information

EF Core 6.0 is the next release after EF Core 5.0 and is currently scheduled for November 2021 at the same time as .NET 6. EF Core 6.0 will align with .NET 6 as a long-term support (LTS) release.

EF Core 6.0 will likely target .NET 6 when released. It is unlikely to support any .NET Standard version. It will not run on .NET Framework. See the future of .NET Standard for more information.

Themes

Highly requested features

As always, a major input into the planning process comes from the voting (👍) for features on GitHub. For EF Core 6.0 we plan to work on the following highly requested features:

  • SQL Server temporal tables
    • Allow temporal tables to be created via Migrations, as well as allowing access to historical data through LINQ queries.
  • JSON columns
    • Introduce common patterns for JSON support that can be implemented by any database provider.
    • JSON column support will be implemented for SQL Server and SQLite. (Note that the PostgreSQL and MySQL providers already support JSON columns.)
  • ColumnAttribute.Order
    • Allow arbitrary ordering of columns when creating a table with Migrations or EnsureCreated.

Performance

While EF Core is generally faster than EF6, there are still areas where significant improvements in performance are possible. We plan to tackle several of these areas in EF Core 6.0, while also improving our perf infrastructure and testing.

  • Performance infrastructure and new tests
    • Improve the infrastructure for performance tests as well as adding new tests and fixing low-hanging fruit.
  • Compiled models
    • Compiled models will improve startup performance, as well as having generally better performance when accessing the model.
  • TechEmpower Fortunes
    • We plan to match Dapper performance on the TechEmpower Fortunes benchmark. (This is a significant challenge which will likely not be fully achieved. Nevertheless, we will get as close as we can.)
  • Linker/AOT
    • We will continue investigating in making EF Core work better with linkers and AOT. We do not expect to fully close the gap in the 6.0 timeframe, but we hope to make significant progress.

Migrations and deployment

Following on from the investigations done for EF Core 5.0, we plan to introduce improved support for managing migrations and deploying databases. This includes two major areas:

  • Migrations bundles
    • Migrations bundles will provide a simple, robust mechanism for deploying EF Core migrations.
  • Managing migrations
    • Wwe plan to improve the tools and project/assembly management for EF Core migrations.

Improve existing features and fix bugs

  • EF6 query parity
    • We plan to close the query gap to EF6 and make supported EF Core queries a true superset of supported EF6 queries.
  • Value objects
    • We plan to introduce a better experience focused on the needs of value objects in domain-driven design.
    • This approach will be based on value converters rather than owned entities which have proved not to be a good fit.
  • Cosmos database provider
    • We are actively gathering feedback on which improvements to make to the Cosmos provider in EF Core 6.0; please make sure to vote (👍) for the Cosmos features that you need.
  • Expose model building conventions to applications
    • Model building conventions are currently controlled by the database provider. In EF Core 6.0, we intend to allow applications to hook into and change these conventions.
  • Zero bug balance (ZBB)
    • We plan to fix all outstanding non-blocked bugs during the EF Core 6.0 timeframe.
  • Miscellaneous smaller features
    • Split query for non-navigation collections
    • Detect simple join tables in reverse engineering and create many-to-many relationships
    • Complete full/free-text search on SQLite and SQL Server
    • SQL Server Spatial Indexes
    • Mechanism/API to specify a default conversion for any property of a given type in the model
    • Use the new batching API from ADO.NET

.NET integration

The EF Core team also works on several related but independent .NET Data technologies. In particular, we plan to work on:

  • Enhancements to System.Data
    • Implementation of the new batching API
    • Continued work with other .NET teams and the community to understand and evolve ADO.NET
    • Standardize on DiagnosticSource for tracing in System.Data.* components
  • Enhancements to Microsoft.Data.Sqlite
    • Connection pooling
    • Prepared statements
  • Nullable reference types

Experiments and investigations

The EF team is planning to invest time during the EF Core 6.0 timeframe experimenting and investigating in two areas. This is a learning process and as such no concrete deliverables are planned for the 6.0 release.

  • SqlServer.Core
    • An experiment in collaboration with the community to determine what potential there is modern .NET features in a highly performant SQL Server driver.
  • GraphQL
    • We plan to investigate the space and collaborate with the community to find ways to improve the experience of using GraphQL with .NET.

Find out more and give feedback

This post is a brief summary of the full EF Core 6.0 Plan. Please see the full plan for more information.

Your feedback on planning is important. The best way to indicate the importance of an issue is to vote (👍) for that issue on GitHub. This data will then feed into the planning process for the next release.

In addition, please comment on this issue if you believe we are missing something that is critical for EF Core 6.0, or are focusing on the wrong areas.

ajcvickers avatar Jan 13 '21 15:01 ajcvickers

Great and ambitious plan, would be fantastic if you could do:

Detect simple join tables in reverse engineering and create many-to-many relationships

early so I can get it in EF Core Power Tools asap. 😎

ErikEJ avatar Jan 13 '21 17:01 ErikEJ

JSON Columns has a lot of potential. Are you planning on making them queryable?

*EDIT: Corrected 'JSON Tables' to 'JSON Columns'

Tiberriver256 avatar Jan 13 '21 17:01 Tiberriver256

@Tiberriver256 What is "JSON Tables" - CosmosDB ??

ErikEJ avatar Jan 13 '21 17:01 ErikEJ

@ErikEJ - Typo meant it to be 'JSON Columns'

Tiberriver256 avatar Jan 13 '21 17:01 Tiberriver256

To be sure, does this tie into SQLServer JSON storage format? As in: https://docs.microsoft.com/en-us/sql/relational-databases/json/store-json-documents-in-sql-tables?view=sql-server-ver15 How would that syntax look like, just Linq2EF like now?

aredfox avatar Jan 13 '21 18:01 aredfox

Currently EF is at 157k RPS and goal is to get as close to 198k as possible? If I read fortunes results right

domagojmedo avatar Jan 13 '21 19:01 domagojmedo

:eyes:

Pilchie avatar Jan 13 '21 20:01 Pilchie

SqlServer.Core An experiment in collaboration with the community to determine what potential there is modern .NET features in a highly performant SQL Server driver.

I have pondered whether rewriting the driver from scratch using System.IO.Pipelines would be beneficial. As an individual working on Sql in my spare time it's not a project that is worth starting, I'd never finish. As a group it might stand a chance of getting somewhere.

Wraith2 avatar Jan 13 '21 23:01 Wraith2

@Wraith2 Your name has been mentioned as we discussed this. We're certainly hoping you will get involved! :-)

ajcvickers avatar Jan 13 '21 23:01 ajcvickers

@aredfox Yes, but I'm not sure what it looks like to query. @roji?

@domagojmedo Not sure which round is currently published and whether we are starting from that, or from where we are internally. @roji?

ajcvickers avatar Jan 13 '21 23:01 ajcvickers

Any plan to support MongoDB?

daniel-frank avatar Jan 14 '21 01:01 daniel-frank

Great roadmap! I especially love that you are trying to eliminate bugs and to get query parity with EF6 💯 And of course performance is always appreciated 🚀 The only think that makes me sad is that inheritance for owned types https://github.com/dotnet/efcore/issues/9630 is not in the list. Owned collections are great in the DDD aggregate-children scenario. Not being able to map polymorphic types makes the feature useless in many scenarios.

davidroth avatar Jan 14 '21 07:01 davidroth

Great roadmap, I love it! Any plan to give some love to global query filters? Like the ability to specify and combine multiple global query filters and turn one/some of them off on demand

ilmax avatar Jan 14 '21 11:01 ilmax

I'd have issues when my entities have several levels of inheritance and when using methods in the entity

mike7ang1rdz avatar Jan 14 '21 12:01 mike7ang1rdz

Currently EF is at 157k RPS and goal is to get as close to 198k as possible? If I read fortunes results right

Yes, that's right.

Note that you're looking at the TE round 19 results. While this is the latest round, results are from May, so before .NET/EF Core 5.0 were released (round 20 runs are now in progress). This is an up-to-date view of the latest runs.

roji avatar Jan 14 '21 14:01 roji

@aredfox re JSON support, we don't have all the specifics yet and need to investigate how JSON support looks like across databases (SQL Server, PostgreSQL, MySQL, Sqlite...). For SQL Server specifically, the idea would indeed to translate LINQ queries to the various JSON functions (JSON_VALUE, JSON_QUERY). Re storage, unless I'm mistaken, SQL Server doesn't have a JSON storage type (unlike PG and some other databases), so storage is typically just done in nvarchar columns. As the SQL Server docs mention, it's possible to decompose your JSON document to a relational schema; we may be able to support that via the new value object / value converters feature also planned for 6.0, but it's really too early to tell.

roji avatar Jan 14 '21 14:01 roji

I had a peak through some of the performance backlogs they seem pretty ambitious. I was mostly looking because I was curious if anything mentioned source generators (https://devblogs.microsoft.com/dotnet/new-c-source-generator-samples/) but failed to see it anywhere. Has any thought gone into source generators to convert some of the generated code into compiled code?

Zoxive avatar Jan 15 '21 00:01 Zoxive

@Zoxive we may look into source generators for the compiled model feature (not definite).

Other than that, EF Core performs the bulk of its code generation during runtime, using LINQ expression trees (e.g. materialization logic for reading entities from the database); this is quite different from source generators, which works at build-time, so there's less potential there. We do have some ideas in that direction as well, but they're probably beyond the scope of 6.0.

roji avatar Jan 15 '21 09:01 roji

@mike7ang1rdz Please file a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.

ajcvickers avatar Jan 15 '21 17:01 ajcvickers

what about migrations that support async operations?

kewinbrand avatar Jan 18 '21 21:01 kewinbrand