지능형 전송 레이어 ZeroMQ

-- IT Trend 2012. 11. 9. 11:32
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

ZeroMQ에 대한 소개


ZeroMQ
는 메시징 라이브러리이다. 그것은 많은 수고를 들이지 않고도 복잡한 커뮤니케이션 시스템을 설계할 수 있도록 해준다. ZeroMQ는 스스로를 효율적으로 설명하기 위해 지금까지 많은 노력을 해왔다. 처음에는 '메시징 미들웨어'로 소개되었지만, 나중에는 '스테로이드를 맞은 TCP' 그리고 이제는 '네트워크 스택의 새로운 레이어'라고 말한다.


ZeroMQ (also spelled ØMQ, 0MQ or ZMQ) is a very lightweight message queuing open source software. It doesn't have a stand-alone server; messages are sent directly from application to application. It is very simple to learn and implement. It is composed of one single library called libzmq.dll written in c++ that can be linked to any application. To use it in the .Net environment we need a wrapper for this library which is called clrzmq.dll written in C#.

ZeroMQ can be run on Windows, OS X, and Linux. Several languages can be used to implement applications using ZeroMQ including C, C++, C#, Java, Python This gives the ability to communicate with different applications on different platforms. 


ØMQ (ZeroMQ)의 특징

Ø Concurrency Framework로써 수행가능한 소켓 라이브러리
Ø 클러스터 및 슈퍼 컴퓨팅 환경에서 TCP보다 성능 우수  
Ø 다양한 메시시 처리 방식 제공(inproc, IPC, TCP, Multicast)
Ø N:N처리(fanout, pubsub, pipeline, request-reply)
Ø 확장 multicore 메시지 전달 어플리케이션을 위한 비동기 I/O
Ø 크고 활발한 오픈소스 커뮤니티
Ø Language : C, C++, .NET, Python을 포함한 20가지 이상 지원
Ø OS : Linux, Windows, OS X등 대부분의 OS 지원
Ø iMatix의 전체 상업 지원 LGPL 오픈소스
 
전송 프로토콜
 

  1. TCP (tcp://hostname:port): communication over the network
  1. INROC (inproc://name): communication within the same process (between threads)
  1. IPC (ipc:///tmp/filename): inter-process communication within the same host
  1. PGM (pgm://interface;address:port and epgm://interface;address:port): multicast communication over the network   


단순성


API는 믿을 수 없을 정도로 간단하다. 그렇기에 소켓 버퍼에 계속 '값을 채워' 주어야 하는 생 소켓 방식에 비교하면 메시지를 보내는 것이 정말로 단순하다. ZeroMQ에서는 그냥 비동기 send 호출을 부르기만 하면, 메시지를 별도의 스레드의 큐에 넣고 필요한 모든 일을 해준다. 이러한 비동기 특성이 있기에 당신의 애플리케이션은 메시지가 처리되기를 기다리며 시간 낭비하지 않아도 된다. 0MQ의 비동기 특성은 이벤트 중심의 프레임웍에도 최적이다.

 

ZeroMQ의 단순한 와이어 프로토콜은 다양한 전송 프로토콜이 사용되는 요즘에 적합하다. AMQP를 쓴다면 그 위에 또 다른 프로토콜 레이어를 쓴다는 것은 좀 이상하게 느껴진다. 0MQ는 메시지를 그냥 Blob으로 보기에 당신이 메시지를 어떻게 인코드하든 상관없다. 단순히 JSON 메시지들을 보내던지, 아니면 BSON, Protocol Buffers나 Thrift 같은 바이너리 방식 메시지들도 괜찮다.


The default message types that we can send or receive are string and array of bytes. ZeroMQ does not impose any format on messages that are sent between sockets. We are free to encode our messages; we can use XML, JSON, MessagePack In this article we will use only strings for simplicity.  

확장성


ZeroMQ 소켓들은 저수준처럼 보이지만 사실은 다양한 기능들을 제공한다. 예를 들어 하나의 ZeroMQ 소켓은 복수의 접점을 가질 수 있으며 그들 간에 자동으로 메시지 부하 분산을 수행한다. 또는 하나의 소켓으로 복수의 소스에서 메시지들을 받아들이는 게이트 역할을 할 수도 있다.

 

ZeroMQ는 '브로커없는 설계' 방식을 따르기에 전체의 실패를 초래하는 단일 위치가 존재하지 않는다. 이것과 앞에서 설명한 단순함 그리고 퍼포먼스를 조합하면 당신의 애플리케이션에 분산처리 기능을 넣을 수 있다.


참고 : http://kr.zeromq.org/
참고 : http://www.codeproject.com/Articles/488207/ZeroMQ-via-Csharp-Introduction
참고 : http://blog.naver.com/haje01?Redirect=Log&logNo=130133918260

'-- IT Trend' 카테고리의 다른 글

빅데이터란 무엇인가?  (0) 2012.12.26
SQL과 NoSQL의 장점을 결합한 NewSQL에 대해  (0) 2012.12.21
Apache Ant  (0) 2012.09.06
Milestone  (0) 2012.03.09
Hibernate  (0) 2011.09.22
posted by 어린왕자악꿍