The overall introduction of tribes of trunking communication framework

Source: Internet
Author: User

The next series of articles will be on the cluster communication framework tribes source-level analysis, welcome to discuss.


To combine several machines into a cluster, in order to work together, the communication between members is necessary, of course, this is the core problem that the focus of cluster implementation needs to solve, a powerful communication synergy mechanism is the base of the cluster.

To put it simply,Tribes is a stand-alone message framework that allows you to send and receive information through the network to group members, and dynamically detect the group communication capabilities of other nodes. Information replication and member maintenance among group members is a relatively complex task, because not only is it necessary to consider the various communication protocols but also the mechanisms required to provide different levels of message transmission assurance, and the maintenance of membership is timely and accurate, as well as for IO Different scenarios need to provide different IO modes, which are some of the considerations that need to be taken into account for group member message transmission. and Tribes The Point-to-point, point-to-group communication is very simple and relatively flexible.

Tribes has a message reliable transport mechanism, which is based on TCP protocol transmissionBy default,TCP has three handshake mechanism guaranteed and has a flow control mechanism, In addition, there are three levels of message reliability assurance at the application level:

①no_ack level, which is the lowest reliable level, when using this level is considered Tribes Once the message is sent to the socket The Send queue considers the Send to be successful, although an exception occurred during transmission, which may not have been received by the receiver, which is the quickest way to send.

②ACK level, which is the most recommended way to ensure that the receiving party can definitely receive the message,Tribes Sending a message to another node will only be considered successful if it receives a confirmation from the recipient, which guarantees the reliability of the message at a higher level, but the delivery efficiency will be affected because each message needs to be confirmed and not confirmed to be re-sent.

③sync_ack level, this method not only guarantees the success of the transfer, but also guarantees that the execution succeeds,Tribes sends the message to other nodes, the receiver does not return the ACK immediately. confirmation is the processing of the received message until the processing succeeds to return ACK confirmation. If the receiving successful processing fails the recipient returns ack_fail to the sender, the sender will resend. Of course, this level of message delivery efficiency is the slowest.

WholeTribesThe design core can be expressed inIOlayer has three important modules, whichMembershipservicemodule is responsible for the maintenance of group membership, including the maintenance of existing members and the discovery of new members, these tasks are automatically completed module, you do not have to care about the team members of the maintenance work;Channelsendermodule is responsible for sending messages to other members of the group and the detailed implementation of various mechanisms;ChannelreceiverThe module is used to receive a detailed implementation of the messages sent by other members in the group and their various mechanisms. The reliability of the message is throughChannelsenderandChannelreceiverare guaranteed at different levels of synergy. The interceptor stack provides some extra action on the message before it is delivered to the application layer, such as filtering and encoding some information, and finally to the application layer, in most cases we only need to focus on the application layer of things that can be used, the application level is mainly some listeners, So as long as you implement the method specified in the listener, you canIOthe messages that are sent over the layer are processed logically.

Interceptor, listener is the introduction of the classic model, abstract a bottom layer as a data processing tier, to achieve a variety of complex communication and mechanisms, while the interceptor is a unified additional processing of the underlying data, the listener as an interface to provide the application layer of data to do business logic processing, formed an elegant design scheme.



Students who like to study Java can make a friend:


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The overall introduction of tribes of trunking communication framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.