go - Is it possible for Google App Engine string and integer datastore keys to clash? -


this question has answer here:

i have datastore entity of kind myentity , want use stringid keys , other times use intid keys generated allocateids.

can safely mix string , integer ids without worrying string id might surreptitiously overwrite integer id generated allocateids , vice versa?

the reason ask because assume string , integer ids use same index. possible accidentally have sequence of bytes represent string id same sequence of bytes represent integer id on same index? or string , integer ids namespaced in way prevent collisions?

yes, can safely mix string & int ids same kind - same key (entity) can not use both @ same time. there no danger of overlapping. guess under hood use protocol buffers serialize key []byte.

i used in production without issues.

though maybe not best design depends on case.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -