Key(MODEL_NAME, 123456789, namespace=NS_1)
Key(MODEL_NAME, 123456789, namespace=NS_2)
In order to effectively address your question, I would like to take a moment and explain the characteristics of a Entity. Each entity within Datastore has a key that uniquely identifies it. The key (as you provided) consists of the following components:
1. Namespace of the entity2. The kind of entity (categorized for queries)
3. An Identifier for the individual entity (can be a key name string or a integer numeric id.)
I will be assuming that you are referring to the integer numeric id for your question.
As far as having two of the same numeric ID's goes, indeed it is possible and this can be done by having your application assign their own numeric IDs manually to the entitles being created. However, as indicated in the documentation here, "there is nothing to prevent a Datastore mode database from assigning one of your manual numeric IDs to another entity". You will have to implement the allocateids() method within your application which will allow you to obtain a block of IDs in order to avoid the conflict mentioned above.
Hi,
I understand your use case and I think the best way to accomplish that would be something like suggested in this StackOverflow post and set up your own GUIDs.
I hope that helps!
I’m glad to know we were able to help you,
Have a great day!