Is it possible for Google App Engine string and integer datastore keys to clash? [duplicate]
This question already has an answer here: Can I use AllocateIDs as “string” ? datastore 3 answers I have a datastore entity of kind MyEntity and I want to sometimes use StringID keys and other times use IntID keys generated by AllocateIDs. Can I safely mix string and integer IDs without worrying that a string ID might surreptitiously overwrite an integer ID generated by AllocateIDs and vice versa? The reason I ask is because I assume string and integer IDs use the same index. Is it possible to accidentally have a sequence of bytes that represent a string ID be the same as a sequence of bytes that represent an integer ID on the same index? Or are string and integer IDs namespaced in some way to prevent collisions?
Yes, you can safely mix String & Int IDs for the same kind - just the same key (entity) can not use both at the same time. There is no danger of overlapping. I guess under the hood they use something like protocol buffers to serialize a key to byte. I used it like that in production without any issues. Though it maybe not the best design but it really depends on your case.
Google App Engine PIL support
Multiple Services with Google App Engine Flexible Environments
Switching across region for failover
Editing appengine static site
gcloud:run error Application does not exist
Error Reporting with App Engine Flexible Environment
golang datastore projection query returning empty strings from a populated entity
Best way to initialize datastore w/ related entities
Google Identiy Toolkit Random OAuth Error
Maintaining separate environments with no downtime on update in app engine
managing app engine versions through API calls
Go GAE Using LoginURLFederated function returns API error 2 (user: NOT_ALLOWED)
Approaches for overcoming 10000 file limit on Google App Engine?
App Engine: Copy live Datastore to local dev Datastore (that still works)
All of my applications throw “deadline was exceeded”. GAE breakdown?
Splitting entities vs. using transactions