Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
ATProto Wiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Collection
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Architecture == === Structure and Addressing === Within a collection, individual records are identified by a unique key, known as a [[record key (rkey)]]. The combination of a user's [[Decentralized Identifier (DID)]] or [[handle]], a collection NSID, and a record key forms an [[AT URI]] that uniquely identifies any record within the network. For example:<syntaxhighlight lang="text"> at://did:plc:abcdef123456/app.bsky.feed.post/3jui7kdo2ck </syntaxhighlight>This URI points to a specific post (with key <code>3jui7kdo2ck</code> in the <code>app.bsky.feed.post</code> collection of the user with the specified DID. Record keys are typically generated as [[Timestamp Identifier (TID)|Timestamp Identifiers (TID)]] which embed creation time information, though other formats are supported for specific use cases. The key format requirements are defined by the [[lexicon]] for each collection's record type. === Indexing and Querying === Collections are an indispensible part of the network's indexing infrastructure. [[Relay|Relays]] and [[AppView|AppViews]] use collection NSIDs to filter and process specific types of records from the [[firehose]] of network activity. This allows them to build specialized indices and provide efficient query capabilities for particular content types. For example, an AppView might specifically index the <code>app.bsky.feed.post</code> and <code>app.bsky.feed.like</code> collections to build a timeline view, while ignoring other collections that aren't relevant to that particular feature. === Data Portability === The collection-based organization of repositories facilitate data portability within the AT Protocol. When users migrate between [[Personal Data Server (PDS)|Personal Data Servers (PDSes)]], their entire repository, including all collections and records, can be exported and imported as a unit, preserving the organizational structure and relationships between records. === Security and Access Control === Collections provide a natural boundary for access control policies. While most collections in the current AT Protocol implementation contain public records, the architecture supports future extensions for collection-level privacy settings. For example, future implementations might include private or group-restricted collections that are only visible to specified users or groups, enabling private messaging and selective sharing features. === Repository Implementation === In the underlying [[data repository]] implementation, collections are represented as paths within the [[Merkle Search Tree (MST)]] data structure. The MST organizes records hierarchically, with collection NSIDs forming part of the peath for each record. When a PDS receives a request to create or update a [[record]], it validates that the record's <code>$typr</code> field matches the collection NSID where it's being stored to ensure type consistency within collections and prevent misplaced records. [[Category:Data structures]]
Summary:
Please note that all contributions to ATProto Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
ATProto Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width