Wondering how URI values are used inside mastodon

Hi! I’m a little bit curious about the uri field used in almost every table like status, preview cards, links and etc.

I know that they are automatically generated and are unique on one instance. So what are they used for and when are they used? Like, searching uri in webui? Or comparing incoming status with database ones?

And, one more thing here, although those uris are formatted in https://instance.domain/UUID format, they can not be accessed externally. So are this somewhat links used internally?

Just curious about the database schema, nothing went wrong within my server. Thanks for your reply in advance!

Most of those can be accessed externally. They are used primarily as identifiers for federation. Every ActivityPub activity/object has an id, which is an URI that in most case can be dereferenced (doing so may require authentication through HTTP Signatures)

1 Like

I see that. Thanks a lot for your answer!

Hi! There’s one more question about uri i want to know about.
In a DB record, there are both ID and uri for one object. When an internal action performs, will the code look for ID or uri (like boosting or favoriting a local post)? And if I want to interact with some remote objects(like favoriting remote posts), it is the time when uri is called. Is that correct?

(Sorry for my poor understanding of the code here.)

Just noticed that the metaboard had been discontinued. So i shall move the question to GitHub discussions. Thank you @Claire!

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