<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I can't speak to ease of building user
interfaces, as we're building<br>
web security components. We started off using Webmachine, and<br>
were pretty happy with it. But some of our REST services were
sending<br>
very large messages, and the memory consumption of Webmachine,<br>
which uses strings, became a big problem. Cowboy uses binaries<br>
instead, and was a much more comfortable fit. We also need to<br>
implement various binary protocols, and being able to do so using<br>
Cowboy's underlying Ranch acceptor pools was a big win.<br>
<br>
Converting Webmachine apps to Cowboy apps was pretty
straightforward,<br>
and Cowboy feels like a more mature and feature rich Webmachine.
As<br>
you evaluate your options, I'd consider these as two
implementations<br>
of the Webmachine model, and go with the Cowboy implementation if<br>
you choose that route.<br>
<br>
<br>
<br>
<br>
On 3/7/16 2:46 PM, Vlad Dumitrescu wrote:<br>
</div>
<blockquote
cite="mid:CAA-EFXvC2p5LcRVCvXs6Pp=TJOnkf4TVQN56FnivzyAWuFfwGA@mail.gmail.com"
type="cite">
<div dir="ltr">Thanks, Loïc, I will then check out Cowboy in more
detail, to see how it feels.
<div><br>
</div>
<div>regards,</div>
<div>Vlad</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Mar 7, 2016 at 8:44 PM, Loïc
Hoguin <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">On 03/07/2016 08:27 PM, Vlad Dumitrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<br>
<br>
I am an almost complete noob regarding this, so please
excuse me if I am<br>
asking questions with obvious answers.<br>
<br>
I have an application that I'd like to expose via a REST
api. From what<br>
I could find quickly, in the Erlang world it looks like
the main options<br>
are Webmachine and Cowboy.<br>
<br>
Does anyone have any advice on which one fits better my
requirements, as<br>
below?<br>
<br>
- the server must be embeddable in another application,
i.e. possible to<br>
start/stop without a release<br>
</blockquote>
<br>
</span>
No problem for that with Cowboy, either through a function
call or provided child specs.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
- it must be possible to configure it to use a dynamic
port value<br>
(multiple independent servers may run on the same
machine)<br>
</blockquote>
<br>
</span>
No problem, set {port, 0} option and then call
ranch:get_port/1.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
- the REST API is delegating to an Erlang API, so ease
of implementation<br>
would be nice :-)<br>
</blockquote>
<br>
</span>
Cowboy is inspired by Webmachine so I suppose they're pretty
close for this one.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
- if it is possible to run multiple servers on the same
Erlang runtime,<br>
then it would be a big plus<br>
</blockquote>
<br>
</span>
No problem, just declare more than one listener and you're
good!<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Loïc Hoguin<br>
<a moz-do-not-send="true" href="http://ninenines.eu"
rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
Author of The Erlanger Playbook,<br>
A book about software development using Erlang<br>
</font></span></blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>