google-app-engine


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.

Related Links

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

Categories

HOME
shell
asp.net-web-api
phpword
swt
apache-spark-mllib
graphics
sublimetext
nsbundle
emscripten
babeljs
vert.x
fosrestbundle
32bit-64bit
mxgraph
redis-sentinel
naivebayes
libc
comsol
libusb
null-pointer
standards
fileserver
symbols
blade
exit
easeljs
monit
displaytag
siri
pylons
cppreference
uitapgesturerecognizer
dst
jmockit
card.io
installshield-le
fossil
sql-delete
baidu-map
processwire
numberpicker
stylecop
openrasta
remedy
context-sensitive-grammar
compiler-design
jqchart
lsyncd
gameplay-kit
branch-prediction
stripe-connect
jodd
jboss-tools
aurora
redis-cluster
fuzzywuzzy
exim4
toast
assertion
gocql
batik
typemock
apache-commons-daemon
botan
telepat
openbabel
uncaught-typeerror
sonarqube-5.0
xml-namespaces
menubar
cfcache
amslidemenu
spring-3
jammer
asdf
workitem
abstract-data-type
jquery-1.9
booksleeve
zope.interface
user-tracking
listactivity
entitydatasource
creole
msr
cdonts
svk
cruisecontrol.rb
strtod
dojo-dnd
fdf
idatareader

Resources

Encrypt Message