Git Product home page Git Product logo

Comments (4)

codekoenig avatar codekoenig commented on June 8, 2024

Ideas on how support for automatic partitioning could be implemented in an as flexible and unopinionated way as possible, please chime in.

from aspnetcore.identity.documentdb.

daveh101 avatar daveh101 commented on June 8, 2024

Hi, I'm not remotely thinking that I am a specialist in Identity, or CosmosDB, but I am certainly an interested party, but there could certainly be some big holes in my suggestion.

My understanding of partitions is that Cosmos automatically assigns the partitions in the background, keeping track of what partition keys are in what partition. Everything with the same partition key is guaranteed to be on the same partition.

I think the easiest way to do this is to have 3 documents. The main user document which will have the userId (or some guid/random string) as the partition key, and in general any other documents for that known user would have the same partition key, keeping all their documents on the same partition.

The other 2 documents are very small and are used to find the partition key for the main document. One would be for finding the user by the user name, and would have a partition key that is the user name. All this document really contains is the partition key for the main user document that work can then be performed from. The other one would basically be the same, but with the user id (or whatever other info is used to search for the user) instead of the user name.

Does that make sense? I appreciate that it will mean there are always 2 files to read when someone logs in, but don't think this would be too much overhead would it??

from aspnetcore.identity.documentdb.

dominikfoldi avatar dominikfoldi commented on June 8, 2024

Do you have any progress on this? We would like to use this repository in our project with partitioned Cosmos DB, but with the current implementation we can't.

@daveh101 I think your idea is good because by querying by partitionkey is almost free in cosmosdb so you can get the partitionkey for almost free and then query for the user also for free.

from aspnetcore.identity.documentdb.

pcbl avatar pcbl commented on June 8, 2024

Hi Folks,

Is there any update on this topic? I see the thread is quite long out there so just wanted to ping if there`s any update on it...

from aspnetcore.identity.documentdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.