FabricLabs / soundtrack

Self-hosted collaborative music playing application.
https://soundtrack.io
126 stars 52 forks source link

Federated servers #47

Open fractaloop opened 11 years ago

fractaloop commented 11 years ago

Federation

soundtrack.io would benefit from federated servers. In the context of federation, each server maintains an internal message queue and is referred to as a broker. Brokers can discover each other and join a federation. The network must support

Discovery

Servers will need the ability to discover one another. This will require at least 1 central peer that can provide other nodes. Each server is responsible for maintaining a list of the servers it is responsible to.

Chat

Each server is responsible for it's own channel. Server name requirements are TBD. Additionally, there will be an optional global chat, or lobby, that allows users to broadcast messages to all connected users in the federation.

Implementation

The federation is represented as a directed acyclic graph. Each broker can have at most 1 parent broker, and any number of children brokers. When links are established between brokers, a dialback is required to establish the identity of the server.

When a message is generated on a server, it is broadcast to its parent and all of its children, which is replicated across the network until all nodes have been visited.

Network splits

In the event of a network partition, all users that are no longer members of a brokers federation will be removed from the list of active users. After partition recovery they will rejoin the list of active users.

martindale commented 10 years ago

@gordonwritescode, this may interest you.

martindale commented 9 years ago

Now tracking this upstream, in martindale/maki#21. This forms the foundation for Fabric.