-
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
Cosmos DB provider #8443
Comments
We should consider investing on this. Keeping it in the backlog for now because we don't have short term plans for it. |
We are going to start investigating this in 2.1. We have a lot of work to do to figure out what the goals should be for EF Core support for Cosmos DB in the short and long term, e.g. from answering basic questions like what value EF Core support should bring to the table to which exact APIs of Cosmos DB we should support. |
I would love to see support doe take, skip foe paging as at present Cosmos doesn't server side support paging as I understand it |
@MisinformedDNA from our initial discussions with Cosmos DB, we are not likely going to target the Table Storage API. We could close #1142 because we are not doing it, but it is not necessarily encompassed. |
Now that EF core 2.0 has been released. Hopefully this can get considered for 2.1 now <3 |
@divega Cosmos DB is essentially four different APIs to do different things. I would expect either a single Cosmos DB provider to handle all four APIs (seemingly this issue) or four separate Cosmos DB providers, one for each of Cosmos DB's APIs. The latter seems more reusable, composable and maintainable. |
This will be an interesting feature. Just curious, any planned date for 2.1 release of EF? Will be helpful for new projects with more interesting use cases. |
@satyajit-behera The EF Core roadmap follows the ASP.NET Core roadmap, which you can see here: https://github.com/aspnet/Home/wiki/Roadmap (or maybe the .NET Core roadmap??? https://github.com/dotnet/core/blob/master/roadmap.md ) |
Neither of those roadmaps acknowledges the existence of Cosmos DB. Does this mean there is no plan for EF to support Cosmos DB? |
A question. Will you be building a default ExecutionStrategy for the cosmos provider in a similar way to SQL Server's |
@JonPSmith I think it is already built into the Cosmos SDK - but of course it would be nice to be able to configure the options https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.connectionpolicy.retryoptions?view=azure-dotnet |
Thanks @ErikEJ, I had a look at the actual code and there is a var builder = new DbContextOptionsBuilder<NoSqlDbContext>()
.UseCosmos(
"urltocosmos",
"somelongkey",
"databaseName",
options => options.ExecutionStrategy(c => new CosmosExecutionStrategy(c))); |
@JonPSmith Cosmos will use a retrying execution strategy by default, so the user doesn't need to specify one unless they need to change the way it behaves. |
@AndriySvyryd. Thanks for letting me know about that as I am writing an article on EF Core and Cosmos DB and was going to put the ExecutionStrategy on my example PS. It makes sense that retries on with Cosmos as it doesn't support transactions, so there is no down side by having retries on. |
@AndriySvyryd What about retries for 412? Will we support ETag concurrency in the cosmos DB provider? |
@Mortana89 We'll likely throw a DbConcurrencyException, but it would be up to the caller to decide how it should be handled - like resending updates for all entity types overriding any changes or querying the updated data, determining which ETags are mismatched and merging the changes. |
Hi everyone! I'm using the CosmosDB EF Core Provider 2.2.4 and here's the strange issue - EF Core seems to ignore the So the next time I try to deserialize it, I've got So the questions -
|
@Bassist067 The Cosmos provider currently doesn't handle any attributes. Properties of nullable type generally accept nulls by default. |
All the feature work planned for 3.0 has been completed. |
Hi, Any plan to support EF Core for Cosmos Db Gremlin Api? |
@githubavi Currently no plans. |
EDIT: apparently the ETag concurrency token was implemented recently by this PR: #19581 Few questions that popped-up after creating a simple CRUD REST API with CosmosDB:
|
@richardrobberse CosmosDB provider isn't even remotely close for being used in a realworld use case. Maybe .net 5. |
That's quite a statement |
@richardrobberse Look at all of the basics it doesn't support (try sub arrays of objects the CosmosDb way, I dare you) and tell me that I'm wrong. You can't take any marginally complex CosmosDb database with multiple collections and make it work in EF Core 3.1 as it stands today. The basics (like concurrency) aren't there. |
@JohnGalt1717 I'm not in need of anything complex, I just need a simple CRUD API so I think I'll manage once the concurrency gets added (hopefully in 3.1.2) Have you tried to use the CosmosDB SDK? There's not much documentation on it but I managed to get it to work at some point, I wasn't satisfied with my implementation so I kind of moved away from it. |
@richardrobberse Just use direct CosmosDb table api with linq until they get it working right and fully support child lists. (i.e. right now you can't even do Contact.Addresses properly with it, so your basic CRUD will probably fail too) |
When it is released, Cosmos ETag concurrency will be handled automatically when a property, shadow or concrete, is mapped to the JSON property entityBuilder.UseEtagConcurrency(); // adds a shadow property for "_etag" as a concurrency token
entityBuilder.Property(x => x.MyProperty).SetEtagConcurrency(); // maps to "_etag" json property, sets concurrency token There is no convention for automatically detecting properties named "etag" or anything similar and making it the concurrency token, it needs to be set explicitly in the fluent API for now. When an entity has an etag concurrency token, it will automatically be included in the |
Note: This issue is for discussion and questions about the EF Core Cosmos provider.
Issue #12086 is tracking the work being done on the implementation.
Please consider creating entity framework core providers for Cosmos DB.
The text was updated successfully, but these errors were encountered: