-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea for EF Core 7: Fetch aggregate entity instance and related tables in single database trip by combining AsSplitQuery and AsSQLBatch #27384
Comments
maulik-modi
changed the title
Retrieve aggregate root and value objects efficiently by user defined Unique Key
Retrieve single instance of aggregate root and related value objects efficiently by user defined Unique Key
Feb 7, 2022
maulik-modi
changed the title
Retrieve single instance of aggregate root and related value objects efficiently by user defined Unique Key
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key
Feb 7, 2022
maulik-modi
changed the title
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - combine AsSplitQuery and AsBatch
Feb 7, 2022
maulik-modi
changed the title
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - combine AsSplitQuery and AsBatch
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - allow combining AsSplitQuery and AsBatch
Feb 7, 2022
maulik-modi
changed the title
Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - allow combining AsSplitQuery and AsBatch
Idea for EF Core 7: Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - allow combining AsSplitQuery and AsBatch
Feb 7, 2022
maulik-modi
changed the title
Idea for EF Core 7: Retrieve single instance of aggregate root and related value objects efficiently by user defined natural key - allow combining AsSplitQuery and AsBatch
Idea for EF Core 7: Fetch aggregate entity instance and related tables in single database trip by combining AsSplitQuery and AsSQLBatch
Feb 7, 2022
Duplicate of #10879 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem statement
Considering the relational database schema, I am wondering best way to retrieve/model aggregate root and value objects with required FK efficiently by user defined Unique key(ClientId).
We have many real world requirements, I am here illustrating the case with famous Dundesoftware recommended by @blowdart in https://devblogs.microsoft.com/dotnet/asp-net-core-6-and-authentication-servers/ and maintained by @leastprivilege and @brockallen
Expected output from EF Core (Note there is no GO statement between queries)
Scenario
Constraints
Design goals
Two attempts to fix (Poorly performs in production)
https://github.com/DuendeSoftware/IdentityServer/blob/5.2.4/src/EntityFramework.Storage/Stores/ClientStore.cs#L53-L70
https://github.com/DuendeSoftware/IdentityServer/blob/releases/6.0.x/src/EntityFramework.Storage/Stores/ClientStore.cs
Performance related customer reported issues
DuendeSoftware/IdentityServer#694
DuendeSoftware/IdentityServer#668
https://github.com/DuendeSoftware/IdentityServer/discussions/667
It all started here DuendeSoftware/IdentityServer#298
Proposed solution (Need to satisfy design goals)
Use AsSplitQuery to generate Inner join style query between aggregate root and value object
Take advantage of ADO.NET Batch to run all Split queries in single database trip as initiated by @roji dotnet/runtime#15375, something like AsBatch() considering EF Core team has #18990 in EF Core 7 roadmap
The text was updated successfully, but these errors were encountered: