Hi team,
Google Cloud Datastore has upgraded its key name limits — it now supports up to 1500 bytes for entity keys (documented here:
https://cloud.google.com/datastore/docs/concepts/limits#entities).
However, Objectify still enforces a hard limit of 500 characters in key names, as seen in classes like Key.java and PathElement.java.
Why this is an issue:
In UTF-8 encoding, a key name can be up to 1500 bytes — which could mean up to 1500 characters (if only ASCII), but fewer if multibyte UTF-8 chars are used.
The hardcoded 500-character limit is now outdated and more restrictive than Datastore’s backend, which rejects only names exceeding 1500 bytes (not characters).
Request:
Please consider updating Objectify to align with Datastore’s official limits:
Allow up to 1500 bytes (rather than 500 characters).
Ideally, validate using name.getBytes(StandardCharsets.UTF_8).length rather than name.length().
This would allow Objectify users to fully utilize Datastore’s expanded key length limits without needing to patch Objectify or bypass it using low-level Datastore client libraries.
Thank you!