Are you still learning socket programming? Why is epoll better than select?
Oh, no!
In a complex cloud computing environment, the challenges we face are far more complex than this one.
A huge server cluster, as a computing cloud, may be a simple search box. Inside the cloud, complicated interconnection and mass communication, coupled with an unstable network environment, low availability of cheap servers-building a cloud computing environment with high availability and scalability is not that easy!
Why is zeromq the best communication library in the cloud computing era? Let's analyze the zeromq features:
1. the socket library that acts as a concurrency framework.
It is like a socket library of the parallel development framework.
Why does a communication library look like a parallel library instead of a socket style?
Cloud computing is not just distributed computing!
Parallel, multi-core, and distributed computing capabilities are constantly extended, and data is constantly partitioned and partitioned. This is how powerful computing capabilities are accumulated.
Concurrency is currently the topic of the cloud computing world. Therefore, zmq provides a concurrent library, which is what we need most.
As the advertisement says: what customers want is not a 1 inch drill bit, but a 1 inch hole.
What we want is distributed parallel computing instead of communication.
2. Carries messages extensions SS inproc, IPC, TCP, and multicast.
Provides message communication in the process, between processes, between machines, and broadcast mode.
Zmq provides a powerful adaptability to complex environments.
As a communication library, we may feel that intra-process communication and inter-process communication are not important.
However, zmq provides these features to provide specific solutions in specific scenarios. And the communication configuration is quite simple: inproc: //, IPC: //, TCP: // The three communication schemes can be simply specified in the string. Developers can easily develop O & M applications. In different scenarios, they can only modify the configuration file to adapt to complicated deployment environments.
3. Connect N-to-N via fanout, pubsub, pipeline, request-reply.
Provides multiple-to-one, publish/subscribe (One-to-least), Pipeline (One-to-one), Request/response models.
Mode or mode.
(I don't fully understand fanout. I think it should be a many-to-one scenario in network communication)
People who develop networks every day may think that communication is a trigger, and classic models are constantly repeating. However, we still write similar code on specific issues.
Zmq not only provides this: zmq is like a bunch of pipe adapters. In a complex water supply system, zmq can be flexibly adapted to each joint and connected like a pipe, separate or merge data.
For example, data is first distributed to multiple servers in pub/sub mode, and processes on each server use inproc in the process to distribute requests to multiple threads for processing, if you have special requirements, you can also forward data to other processes on the same machine in the IPC mode. To complete all these complex tasks, you only need less code.
4. fast enough for clustered products and supercomputing.
The server cluster and super computing will be fast enough.
What else do you want to do?
5. asynch I/O for scalable multicore message-passing apps.
Provides asynchronous I/O support for scalable multi-core messaging applications.
In the inproc: // mode of zmq, the Library provides a thread-safe message distribution mechanism to distribute requests to multiple threads.
6. Large and active open source community.
An extremely large and active open-source community
Remember, you are not fighting alone! No ......
7. 20 + languages ages including C, C ++, Java,. net, Python.
More than 20 development languages, such as C, C ++, Java,. net, and Python
8. Most OSes including Linux, windows, OS X.
It also supports most operating systems, such as Linux, windows, and OS X.
9. lgpl free software with full technical cial Support.
This is the most important thing. Don't pay for it, but it can also provide commercial support.
Note:
Fan out: a very important concept in digital power. "the output of a logic gate needs to drive the input of multiple equivalent doors, and the output end needs to drive the equivalent number of doors to fan out f ".
Fan-out is the term used to define the maximum input of digital signals that a single logic gate can drive.
From: http://hi.baidu.com/ah%5F%5Ffu/blog/item/fd73593ebb3dd6e8828b13a3.html