Server-Server API: Difference between revisions

From IM Wiki
Jump to navigation Jump to search
Matrix>Ari
mark as server software
Matrix>Ari
No edit summary
Line 11: Line 11:
EDUs and PDUs are further wrapped in an envelope called a [[Transaction]], which is transferred from the origin to the destination homeserver using the HTTP PUT request.
EDUs and PDUs are further wrapped in an envelope called a [[Transaction]], which is transferred from the origin to the destination homeserver using the HTTP PUT request.


These requests are a base of what makes Matrix a decentralized protocol as these APIs make Federation possible. For client-to-server communication read [[Client-Server_API|Client Server API]].
These requests are a base of what makes Matrix a decentralized protocol as these APIs make Federation possible. For client-to-server communication read [[Client-Server_API|Client-Server API]].

Revision as of 18:09, 19 January 2024

Matrix homeservers use Federation APIs (also known as Server-Server APIs) to communicate with one another. Homeservers use these APIs to post and query various data from other homeservers in real-time to and from one another. These APIs are implementing using HTTP secure (HTTPS) requests between independent nodes implementing the Matrix protocol, these requests are strongly authenticated on the TLS transport layer.

There are main kinds of Federation between the servers:

  • Persistent Data Units (PDUs): These events are broadcast from one HS to another HS to store persistent data (such as room state)
  • Ephemeral Data Units (EDUs): These events are pushed between pairs of homeservers, these events are not persisted on the homeservers (such as typing notification)
  • Queries: These are single request-response interactions between a given pair of servers, they are usually defined by the GET HTTP request and they are not persisted anywhere. They simple request a snapshot of state of the requested resource (such as searching in rooms)

EDUs and PDUs are further wrapped in an envelope called a Transaction, which is transferred from the origin to the destination homeserver using the HTTP PUT request.

These requests are a base of what makes Matrix a decentralized protocol as these APIs make Federation possible. For client-to-server communication read Client-Server API.