Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Server-to-Server Communication

Received: by 10.204.149.65 with SMTP id s1mr5574743bkv.3.1351373539191;
        Sat, 27 Oct 2012 14:32:19 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.204.129.72 with SMTP id n8ls5558094bks.0.gmail; Sat, 27 Oct
 2012 14:31:58 -0700 (PDT)
Received: by 10.205.123.145 with SMTP id gk17mr5570969bkc.2.1351373518419;
        Sat, 27 Oct 2012 14:31:58 -0700 (PDT)
Received: by 10.205.123.145 with SMTP id gk17mr5570968bkc.2.1351373518386;
        Sat, 27 Oct 2012 14:31:58 -0700 (PDT)
Return-Path: <ja...@nodefly.com>
Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47])
        by gmr-mx.google.com with ESMTPS id 27si520688bks.3.2012.10.27.14.31.57
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 27 Oct 2012 14:31:58 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.215.47 is neither permitted nor denied by best guess record for domain of ja...@nodefly.com) client-ip=209.85.215.47;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.215.47 is neither permitted nor denied by best guess record for domain of ja...@nodefly.com) smtp.mail=ja...@nodefly.com
Received: by mail-la0-f47.google.com with SMTP id h5so3026323lam.6
        for <nodejs@googlegroups.com>; Sat, 27 Oct 2012 14:31:57 -0700 (PDT)
        d=google.com; s=20120113;
        h=mime-version:x-originating-ip:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-gm-message-state;
        bh=lvHc+Hh6du7vPVgC2qwzrNEshPZ3baKEDDN7iTmBuvI=;
        b=H6UmOwV81W5entWpPFGMSxKVDkPxbxtua9IpQ2I9IkWSpUvPKuARuImCERwNh9mLkJ
         ZsEA88EL1+5LwjR5+xEJ3IUXrcacW7yvHHcuJy4cP6iVhQb+ea08rw9XFDnp791zbbeK
         MYBgt9tSdBDfbbSSr7IELkv1/amHavADfytiMIZiaLrT5Ljaf/tYuBCFfDuwscwCHOzp
         qaAY9exZ//WK9CYa2iG1QuBXaUaGaSgyslpUAR85C3n2fcfsDyow05RaZc+1E4gAil3G
         N+qHzccl6VPQCn0mXq8n8hWrD6ca2MruwngO7aj471p/BUG3XanvqiIqLV76f84AXTSy
         OZiQ==
MIME-Version: 1.0
Received: by 10.112.45.231 with SMTP id q7mr10271461lbm.133.1351373517605;
 Sat, 27 Oct 2012 14:31:57 -0700 (PDT)
Received: by 10.114.13.201 with HTTP; Sat, 27 Oct 2012 14:31:57 -0700 (PDT)
X-Originating-IP: [108.62.194.125]
In-Reply-To: <be7893a8-d763-4a80-b3c3-a2216b43a75b@googlegroups.com>
References: <CAFzK5Ef1+iMsVdkGAWBtRoUnXy_PdvKnOEG9VAuzW36AnQV...@mail.gmail.com>
	<be7893a8-d763-4a80-b3c3-a2216b43a75b@googlegroups.com>
Date: Sat, 27 Oct 2012 14:31:57 -0700
Message-ID: <CAFzK5Ef=nx91nVy_d3Ut+6aWvFgpa7LvrUqG_wDVz8pvQAk...@mail.gmail.com>
Subject: Re: [nodejs] Re: Server-to-Server Communication
From: Jacob Groundwater <ja...@nodefly.com>
To: nodejs@googlegroups.com
Content-Type: multipart/alternative; boundary=bcaec554df5a79cc4304cd112a53
X-Gm-Message-State: ALoCoQnzkEItt5rnOu1ScY1vZpZ+EWdMrBVSAgCQDVSqmy2nUFNPnyNd8L8M9vPv8YXvQly7hTnW

--bcaec554df5a79cc4304cd112a53
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

It looks like ZeroMQ does not play well with the asynchronous nature of
Node. Take a look at the following gist:

https://gist.github.com/3966362

I would expect to see three replies from the server, except there is only
one. This occurs when the server tries to reply out of order. Changing the
send order to the following works:

sockit('thr').send( JSON.stringify({timeout:0,name:'thr'}) )
sockit('two').send( JSON.stringify({timeout:1000,name:'two'}) )
sockit('one').send( JSON.stringify({timeout:5000,name:'one'}) )



On Sat, Oct 27, 2012 at 11:46 AM, Alexey Kupershtokh <
alexey.kupersht...@gmail.com> wrote:

> I'm also interested in this theme.
>
> AFAIR, dnode 6 months ago was good in features but terribly slow comparin=
g
> to socket.io/axon.
>
> https://github.com/visionmedia/axon looks interesting, but unstable yet -
> I have already found an issue (
> https://github.com/visionmedia/axon/pull/62 ). Also I don't like it's
> feature to open a new socket/port for each communication type.
>
> Also I don't like Socket.io's feature that it doesn't free ACK callbacks
> (probably already does) which is a leak for long & intensive s2s sockets.
>
> =D7=CF=D3=CB=D2=C5=D3=C5=CE=D8=C5, 28 =CF=CB=D4=D1=C2=D2=D1 2012 =C7., 1:=
32:19 UTC+7 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jacob =CE=C1=D0=C9=D3=C1=
=CC:
>
>> I was wondering what others are using for communication between back-end
>> servers. Since I control all involved servers, I would rather not includ=
e
>> authentication at the application layer. Forwarding SSH ports is perfect=
ly
>> acceptable.
>>
>> On that note, my own research has lead me to three options, in order of
>> personal preference:
>>
>>    1. a message queue (ZeroMQ)
>>    2. websockets (socket.io)
>>    3. synchronize against the database (MySQL or Redis)
>>
>> ZeroMQ seems pretty awesome, but I am curious if anyone has tried it, an=
d
>> what there experience was. For example, I stumbled across an article
>> discussing how their REQ/REP model can lock up easily.<http://lucumr.poc=
oo.org/2012/6/26/disconnects-are-good-for-you/> The
>> workaround is fairly simple, but I am interested in soliciting more
>> experience in the area.
>>
>> Websockets seem like a "native" way, but I see them as living in the
>> client-server domain. For example, I would have to setup express and a
>> basic restful service on each back-end server. Websockets are also 1-to-=
1,
>> where as ZeroMQ supports N-to-N connections.
>>
>> Synchronizing against the database would involve polling to achieve
>> real-time like events. I know Redis supports a pub/sub system, but does =
not
>> seem to have any RPC-like mechanisms.
>>
>> In the end, I will make the decision best suited to our needs, but I am
>> sure I can gain from some discussion on the matter.
>>
>> Thanks everyone,
>>
>> - Jacob Groundwater
>>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=3Den?hl=3Den
>

--bcaec554df5a79cc4304cd112a53
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

It looks like ZeroMQ does not play well with the asynchronous nature of Nod=
e.=9ATake a look at the following gist:<div><br><div><a href=3D"https://gis=
t.github.com/3966362">https://gist.github.com/3966362</a><br><br>I would ex=
pect to see three replies from the server, except there is only one. This o=
ccurs when the server tries to reply out of order. Changing the send order =
to the following works:</div>
<div><br></div></div><blockquote style=3D"margin:0 0 0 40px;border:none;pad=
ding:0px"><div><div><div><font face=3D"courier new, monospace">sockit(&#39;=
thr&#39;).send( JSON.stringify({timeout:0,name:&#39;thr&#39;}) )</font></di=
v>
</div></div><div><div><div><font face=3D"courier new, monospace">sockit(&#3=
9;two&#39;).send( JSON.stringify({timeout:1000,name:&#39;two&#39;}) )</font=
></div></div></div><div><div><div><font face=3D"courier new, monospace">soc=
kit(&#39;one&#39;).send( JSON.stringify({timeout:5000,name:&#39;one&#39;}) =
)</font></div>
</div></div></blockquote><div><div><br></div><div><br></div><div><div>On Sa=
t, Oct 27, 2012 at 11:46 AM, Alexey Kupershtokh <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:alexey.kupersht...@gmail.com" target=3D"_blank">alexey.kupersh=
t...@gmail.com</a>&gt;</span> wrote:</div>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m also inte=
rested in this theme.<div><br></div><div>AFAIR, dnode 6 months ago was good=
 in features but terribly slow comparing to <a href=3D"http://socket.io/axo=
n" target=3D"_blank">socket.io/axon</a>.</div>
<div><br></div><div><a href=3D"https://github.com/visionmedia/axon" target=
=3D"_blank">https://github.com/visionmedia/axon</a>=9Alooks interesting, bu=
t unstable yet - I have already found an issue (=9A<a href=3D"https://githu=
b.com/visionmedia/axon/pull/62" target=3D"_blank">https://github.com/vision=
media/axon/pull/62</a>=9A). Also I don&#39;t like it&#39;s feature to open =
a new socket/port for each communication type.<br>
<br>Also I don&#39;t like Socket.io&#39;s feature that it doesn&#39;t free =
ACK callbacks (probably already does) which is a leak for long &amp; intens=
ive s2s sockets.<br><br>=D7=CF=D3=CB=D2=C5=D3=C5=CE=D8=C5, 28 =CF=CB=D4=D1=
=C2=D2=D1 2012=9A=C7., 1:32:19 UTC+7 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 J=
acob =CE=C1=D0=C9=D3=C1=CC:<div>
<div class=3D"h5"><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">I was wondering w=
hat others are using for communication between back-end servers. Since I co=
ntrol all involved servers, I would rather not include authentication at th=
e application layer. Forwarding SSH ports is perfectly acceptable.<div>

<br></div><div>On that note, my own research has lead me to three options, =
in order of personal preference:</div><div><ol><li>a message queue (ZeroMQ)=
</li><li>websockets (<a href=3D"http://socket.io" target=3D"_blank">socket.=
io</a>)</li>
<li>
synchronize against the database (MySQL or Redis)</li></ol><div>ZeroMQ seem=
s pretty awesome, but I am curious if anyone has tried it, and what there e=
xperience was. For example, I stumbled across an article discussing how the=
ir <a href=3D"http://lucumr.pocoo.org/2012/6/26/disconnects-are-good-for-yo=
u/" target=3D"_blank">REQ/REP model can lock up easily.</a>=9AThe workaroun=
d is fairly simple, but I am interested in soliciting more experience in th=
e area.</div>

</div><div><br></div><div>Websockets seem like a &quot;native&quot; way, bu=
t I see them as living in the client-server domain. For example, I would ha=
ve to setup express and a basic restful service on each back-end server. We=
bsockets are also 1-to-1, where as ZeroMQ supports N-to-N connections.</div=
>

<div><br></div><div>Synchronizing against the database would involve pollin=
g to achieve real-time like events. I know Redis supports a pub/sub system,=
 but does not seem to have any RPC-like mechanisms.</div><div><br></div>

<div>In the end, I will make the decision best=9Asuited=9Ato our needs, but=
 I am sure I can gain from some discussion on the matter.</div><div><br></d=
iv><div>Thanks everyone,</div><div><br></div><div>- Jacob Groundwater</div>

</blockquote></div></div></div><span class=3D"HOEnZb"><font color=3D"#88888=
8">

<p></p>

-- <br>
Job Board: <a href=3D"http://jobs.nodejs.org/" target=3D"_blank">http://job=
s.nodejs.org/</a><br>
Posting guidelines: <a href=3D"https://github.com/joyent/node/wiki/Mailing-=
List-Posting-Guidelines" target=3D"_blank">https://github.com/joyent/node/w=
iki/Mailing-List-Posting-Guidelines</a><br>
You received this message because you are subscribed to the Google<br>
Groups &quot;nodejs&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:nodejs@googlegroups.=
com" target=3D"_blank">nodejs@googlegroups.com</a><br>
To unsubscribe from this group, send email to<br>
<a href=3D"mailto:nodejs%2Bunsubscribe@googlegroups.com" target=3D"_blank">=
nodejs+unsubscribe@googlegroups.com</a><br>
For more options, visit this group at<br>
<a href=3D"http://groups.google.com/group/nodejs?hl=3Den?hl=3Den" target=3D=
"_blank">http://groups.google.com/group/nodejs?hl=3Den?hl=3Den</a><br>
</font></span></blockquote></div><br></div></div>

--bcaec554df5a79cc4304cd112a53--