.NET Core 2.1 Roadmap PT.2

Sign in to queue

The Discussion

  • User profile image
    TheSaintr

    About EF Core CosmoDB.

    Isn't creating a Documento Collection for each "entity" in EF the oposite of what nosql stands for.
    Also in terms of cost you pay for each collection thus imagine a 100 table SQL Azure.... converted to cosmoDb you pay a LOT for that!

  • User profile image
    divega

    @TheSaintr:

    Thanks for the feedback! 

    When we are done with the Cosmos DB support, we will have the ability to model documents as aggregates (a root entity type and a number of owned collections and references). 

    Inheritance will use a collection per hierarchy.

    Then, based on the current plan, you will only have to create a collection for the root hierarchy, as all the owned entity types will be embedded as part of the document.

    We believe this is the most natural way to map EF Core models to a document database, but since as you said, in Cosmos DB, collections are the billing unit, we may need to discuss doing more. 

  • User profile image
    Ponant

    @divega , the UnitOfWork solution is super interesting! However, I totally agree with @TheSaintr and I can say upfront that, yes, you need to discuss more!

    I made a homemade -naive- EF provider for CosmosDb and the way to avoid collection creation per type was to do something like providing the collectionId in the optionsBuilder shown in OnConfiguring, instead of only the database name. The developer should be given the possibility on where to put his entity, i.e. the client name, the database and the collection. Only this will allow them to control pricing.
    An additional thing that could be done is to do type checking which is not a default of documentdb but which you often see used by devs out there. Where is the place we can discuss there?

  • User profile image
    Neel

    Nice. I have written a post on Asp .Net Core 2.1 features which you can find here: https://neelbhatt.com/2018/02/06/asp-net-core-2-1-features/

  • User profile image
    Volodymyr

    Thanks a lot - we are waiting for at least RTM to try it :)

Add Your 2 Cents