Matt LuoM
Convex Community2y ago
11 replies
Matt Luo

Which identifier generator library to use for message channel and threads?

1) I am building a Discord-like messaging experience.
For servers, channel, threads, etc. it appears that Discord uses Snowflake IDs, 18-integer long numeric values.
What would you recommend for a Convex project? It seems that for a single Convex project, IDs that are unique over distributed database nodes is not important, but sort-ability and query performance are important.

If I wanted to keep my programming efforts really simple, I could simply use a _id field values themselves, but 32-characters is a lot of characters to put in URLs, especially when multiple resources are involved.

2) Likewise, what would you recommend for a user profile external identifier? Looks like LinkedIn appends a 8-character long suffix that uses a combination of all-lowercase letters and numbers.
Was this page helpful?