[erlang-questions] REST server

Vlad Dumitrescu <>
Tue Mar 8 21:11:39 CET 2016


Cool, thanks!
/Vlad


On Tue, Mar 8, 2016 at 7:31 PM, Garry Hodgson <>
wrote:

> I can't speak to ease of building user interfaces, as we're building
> web security components. We started off using Webmachine, and
> were pretty happy with it. But some of our REST services were sending
> very large messages, and the memory consumption of Webmachine,
> which uses strings, became a big problem. Cowboy uses binaries
> instead, and was a much more comfortable fit.  We also need to
> implement various binary protocols, and being able to do so using
> Cowboy's underlying Ranch acceptor pools was a big win.
>
> Converting Webmachine apps to Cowboy apps was pretty straightforward,
> and Cowboy feels like a more mature and feature rich Webmachine. As
> you evaluate your options, I'd consider these as two implementations
> of the Webmachine model, and go with the Cowboy implementation if
> you choose that route.
>
>
>
>
>
> On 3/7/16 2:46 PM, Vlad Dumitrescu wrote:
>
> Thanks, Loïc, I will then check out Cowboy in more detail, to see how it
> feels.
>
> regards,
> Vlad
>
>
> On Mon, Mar 7, 2016 at 8:44 PM, Loïc Hoguin <> wrote:
>
>> On 03/07/2016 08:27 PM, Vlad Dumitrescu wrote:
>>
>>> Hi!
>>>
>>> I am an almost complete noob regarding this, so please excuse me if I am
>>> asking questions with obvious answers.
>>>
>>> I have an application that I'd like to expose via a REST api. From what
>>> I could find quickly, in the Erlang world it looks like the main options
>>> are Webmachine and Cowboy.
>>>
>>> Does anyone have any advice on which one fits better my requirements, as
>>> below?
>>>
>>> - the server must be embeddable in another application, i.e. possible to
>>> start/stop without a release
>>>
>>
>> No problem for that with Cowboy, either through a function call or
>> provided child specs.
>>
>> - it must be possible to configure it to use a dynamic port value
>>> (multiple independent servers may run on the same machine)
>>>
>>
>> No problem, set {port, 0} option and then call ranch:get_port/1.
>>
>> - the REST API is delegating to an Erlang API, so ease of implementation
>>> would be nice :-)
>>>
>>
>> Cowboy is inspired by Webmachine so I suppose they're pretty close for
>> this one.
>>
>> - if it is possible to run multiple servers on the same Erlang runtime,
>>> then it would be a big plus
>>>
>>
>> No problem, just declare more than one listener and you're good!
>>
>> --
>> Loïc Hoguin
>> http://ninenines.eu
>> Author of The Erlanger Playbook,
>> A book about software development using Erlang
>>
>
>
>
> _______________________________________________
> erlang-questions mailing ://erlang.org/mailman/listinfo/erlang-questions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160308/25d1b0c2/attachment.html>


More information about the erlang-questions mailing list