Help with Comment IDs

Hi, I don’t know much about Big Systems (like twitch), and in this type of System (related to chat), even in differents videos, the Comment IDs must be unique? If so, is there a mechanism that prevents an id collision (for example, in SQL Server, a PK prevent two Ids from being the same)? If not, why is that not a problem?

Now sure what you refer to here.

What are you trying to do, which API/product are you trying to talk to?

It’s just a question I have about a large-scale database (like Twitch’s), if this question is not contingent here, I apologize and guarantee that it will not be repeated.

Describes youtube’s method for “unique ID’s”

I would predict most people use something similar for GUID generation

There are also a number of technical documents on UUID generation, a quick google returns

Which covers generation.

I doubt you’d get an answer on what Twitch does specifically but there are technical guidelines on this sort of thing

I really like this video, but my question is this way:
let’s use MongoDB and this element in BSON as an example:

videos:
[
{
idVideo: 1,
comments:
[
{id: 1, content: “a”},
{id: 2, content: “b”}
]
},
{
idVideo: 2,
comments:
[
{id: 1, content: “a”},
{id: 2, content: “b”}
]
}
]

would it be correct to use this way (as you can see, the videos contain unique ids, but the comments have unique ids only within that video)?

If we are talking about Twitch Chat.

Twitch Chat/TMI returns a id in the tags which represents the ID of that message.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.