Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Objectify key name limit (500 chars) is outdated — should support 1500 bytes as per Datastore limits #520

@priyanshu-reltio

Description

@priyanshu-reltio

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!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions