Increase Collection name maximum length?

29 views
Skip to first unread message

Massimo Bono

unread,
Sep 1, 2019, 5:04:42 AM9/1/19
to ArangoDB
Hi all,

Just a question: It would be possible (as a feature request) to increase the maximum length of a collection name? As for now, the documentation clearly states:

The maximum allowed length of a collection name is 64 bytes

At the moment I have several collections which I dynamically create. Their names can be lengthy and I keep encoutering error 1208 (collection name illegal name). As a workaround, I'm compressing the collection name to reduce its size, but it would be nicer to increase the collection name length.

I know someone else wanted to increase the character available in the collection name (here) but that is another (closed) issue.

Does it make sense?

Thank you for any kind reply

PS: sorry if I didn't comply with any question guidelines, this is my first time posting here :D

Jan

unread,
Sep 3, 2019, 4:51:38 PM9/3/19
to ArangoDB
Hi,

the maximum length for collection names is currently restricted to 64 characters as you already found out.

ArangoDB should be able to handle longer collection names however. I created a PR with such change for a test and it seems it doesn't require too many changes to pass: https://github.com/arangodb/arangodb/pull/9890
However, there may be client drivers which also enforce the name length limit. For example, if a collection with a name of 65 chars is created in the web UI and then a driver reads it back but has the "old" restriction, things could fall apart.

So it is a bit delicate to change this in the middle of a released version.
It should be doable to perform the change for the release following 3.5, which is right now in development and will be released eventually as 3.6, with a yet-unknown ETA.

Not sure if this helps in your particular case, but making such changes in the middle of a release may have too many unintended side-effects.
Until then, I think a solution that creates a deterministic hash from a long name to produce a collection name of "acceptable" length (i.e. <= 64 chars) should be working.

Best regards
Jan

Massimo Bono

unread,
Sep 4, 2019, 3:46:44 AM9/4/19
to ArangoDB
Hi thanks for the quick reply.

Yes, I completely understand that doing such change may have catastrophic side effect. What I was wishing was to create a feature proposal for the next release, so I have to really thank you.
Viewing your PR, I've just noticed that you plan to increase the maximum character size to 128: this can work, by another person may ending up requiring more characters. What about having a variable deciding the maximum collection name? I doesn't need to be set runtime, maybe just a compile time macro may be sufficient. What do you think?

Regarding the hash: yes, I've already thought that but in my scenario I'm really interested in leaving the collection names human readable. Sadly I think I will have to bite the bullet up until 3.6 and generate hashes. Sad to hear that.

Horacio Hoyos

unread,
Sep 4, 2019, 3:57:23 AM9/4/19
to ArangoDB
To keep collection names still "readable", you might consider disemvoweling. Removing the vowels can save you some space and still make the names human friendly.
Reply all
Reply to author
Forward
0 new messages