유방은 천하를 통일한 후 이렇게 말했다. "장막 안에서 계책을 세워 천리 밖에서 승리를 거두게 하는 데 있어서 나는 장량(張良)만 못하다. 국가의 안녕을 도모하고 백성을 사랑하며 군대의 양식을 대주는데 있어 나는 소하(簫何)만 못하다. 백만 대군을 이끌고 나아가 싸우면 이기고 공격하면 반드시 빼앗는데 있어 나는 한신(韓信)만 못하다. 하지만 나는 이들을 얻어 그들의 능력을 충분히 발휘하도록 해주었다. 바로 이것이 내가 천하를 얻은 까닭이다." - 초한지에서
Spread는 어플리케이션에게 몇가지 서로다른 메세지 서비스 타입을 제공합니다. 수령자 전체 그룹들에게 메세지를 보내거나 현재 접속이 살아있고 메세지가 전달가능한 맴버에 대한 정보를 받는 것에 더하여, Spread는 정렬 및 신뢰성 보장기능을 제공하고 있습니다. 어플리케이션이 Spread 메세지를 전송할 때 해당 메세지에 대한 서비스 레벨을 선택합니다. 선택된 서비스 레벨은 어떤 종류의 정렬 및 신뢰성 설정이 해당 메세지로 제공될 것인지를 조정합니다. 어플리케이션은 전송하고자 하는 각각의 메세지마다 다른 서비스 레벨을 선택하는 것이 가능합니다.
Spread 메세지 서비스 타입들 #
| Spread 서비스 타입 | 정렬 | 신뢰성 |
| UNRELIABLE_MESS | 안함 | 비신뢰적임 |
| RELIABLE_MESS | 안함 | 신뢰적임 |
| FIFO_MESS | Fifo by Sender | 신뢰적임 |
| CAUSAL_MESS | Causal (Lamport) | 신뢰적임 |
| AGREED_MESS | Total Order (Consistent w/Causal) | 신뢰적임 |
| SAFE_MESS | Total Order | 안전함 |
정렬 보장 #
Spread에 정의된 정렬 보장 옵션은 다음과 같습니다
| 안함 | 정렬 보장을 하지 않습니다. 또한 "None" 정렬 옵션으로 전송된 다른 어떤 메세지는 지금 보낸 메세지보다 이전 또는 이후에 도착할 수 있습니다. 보다 엄격한 정렬 옵션을 가진 메세지들은 이 메세지에 의존할 수도 있습니다. 예를 들어, 만약 FIFO_MESS 메세지 M1이 RELIABLE_MESS 메세지 M2 다음에 전송되었다면 M1은 No ordering guarantee. Any other message also sent with ordering "None" can arrive either before or after this one. Messages with stricter ordering CAN depend on this message. For example, if a FIFO MESS message Ma follows RELIABLE MESS message Mb then Ma cannot be delivered until Ma has been delivered (but the reverse is not true). |
| Fifo by Sender | All messages sent by this sender(A sender is defined as a particular connection to a Spread daemon, so an application with 3 connections will be considered 3 different senders) of at least Fifo ordering are delivered in FIFO order. As mentioned above a RELIABLE MESS sent after a Fifo message may be delivered before the Fifo message. |
| Causal (Lamport) | All messages sent by all senders are delivered in an order consistent with Lamport’s definition of "Causal" order. This order is consistent with Fifo ordering. |
| Total Order (Consistent w/Causal) | All messages sent by all senders are delivered in the exact same order to all recipients. This order is also consistent with Causal order. It is provided by making the partial order defined by causal into a total order. The total order uses the id of the sender to break ties. |
It is important to note that messages sent with Fifo ordering or less do not support the full membership semantics of Spread. This is a result of Spread optimizing two common operations, group joins and leaves and sending FIFO or Reliable messages. First, joins and leaves of group members do not cost more then sending one SAFE message and result in no extra synchronization costs. Second, Fifo and Reliable messages are not delayed before delivery by any other messages. So even if gaps exist in the global order of all messages, Reliable messages can still be delivered and Fifo messages can be delivered as long as all the messages from their sender have arrived. Because of these two optimizations, it is possible for a Reliable or Fifo message to be delivered earlier then it would be if it was globally ordered, however a gap in the global sequence may contain a join or leave message (since they are just SAFE messages) so it might be that one process delivers the Fifo or Reliable message before the join and a different process delivers the join first and then the message.
신뢰성 보장 #
Spread에 정의된 신뢰성 보장 옵션은 다음과 같습니다
| 비신뢰적임 | 메세지는 비신뢰적인 방법으로 전송됩니다. 메세지를 잃거나 취소될 수 있으며, Spread에 의해서 복구되지 않습니다. |
| 신뢰적임 | 메세지는 전송될 그룹의 맴버들인 모든 수령자들에게 신뢰적으로 배달됩니다. Spread는 어떠한 네트워크 손실이 발생해도 메세지를 복구합니다. |
| 안전함 | The message will ONLY be delivered to a recipient if the daemon that recipient is connected to knows that all Spread daemons have the message. If a membership change occurs, and as a result the daemon cannot determine whether all daemons in the old membership have the message, then the daemon will deliver the Safe message after a TRANSITIONAL MEMBERSHIP message. |









![[http]](/wiki/imgs/http.png)
