I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a small application for a few months. However, since Cowboy is gaining a lot of traction, I’d like to know what are some pros and cons for:
-
Yaws vs. Cowboy: the first one seems more stable and battle-tested, while I’ve seen a few posts of people saying Cowboy has better performance and seems to have more adoption.
-
Just a Web Server vs. a Web Framework (Phoenix): I’ve never really used a Web Server alone to develop a Web application. From what I’m seeing from exploring Yaws, I really miss Phoenix’s straightforward development and vastness of resources. Yaws seems pretty good, but from what I remember I was way more productive with Phoenix right from the start. So far I can’t really think of any cons against Phoenix, besides the fact that you’re locked into Cowboy and the additional dependencies and heavier weight of all the additional code.
There’s also this post which compares several Erlang and non-Erlang Web Servers, with Misultin and Cowboy coming out on top. Yaws is not present for the following reasons the writer posted:
As a last note, I did not include Yaws for a simple reason: it’s a fully blown up server, the “old guy” is a feature-loaded unquestioned webserver, and because of that I simply thought that it would have been unfair to add it to the comparison. This really sounded to me like apple and peers, not a minor difference of the missing headers you are referring to. IMHO, of course, and I’ll be more than pleased to add Yaws to the next run which I might be called to do.
Anyone know what a “fully blown up server” means in the context of Yaws vs. Cowboy?
5 Likes
Yaws was one of the ‘old days’ erlang web servers. Great to work in, was quite fun, however it was also not very fast, but it was a full framework more along the lines of Phoenix (or even more). I’ve used it decently like a decade ago. ^.^
Cowboy is a very low level network dispatcher, not just for web, anything to do with the network really. Phoenix is built on cowboy. Phoenix is also much faster growing because of Elixir supporting it.
Comparing cowboy and yaws makes no sense, different stacks; comparing yaws and phoenix would make more sense.
Oh wow misultin, Chicago Boss, all kinds of old erlang web things are coming back to me, I’ve at least messed with them all years ago.
But yes, misultin was on the same vein as cowboy, a low level network dispatcher, but not near as fast as cowboy itself. Misultin was actually a newer incarnation of an even older network dispatch that I forgot the name of, but also started with an m
. Chicago Boss was a ‘full fledged framework’, even more so than Phoenix and Yaws, very opinionated but very easy to get stuff done in it.
Someone really should rewrite Chicago Boss on top of phoenix! ^.^
As in huge, Yaws had templating engines, data storage, everything you need. Cowboy is just a little network dispatcher, even the http ranch
handling is just an add-on on it.
6 Likes
I’m a huge Yaws fan for a couple of reasons.
Firstly, because of the Yaws creators. They are rockstars:
These guys are not only brilliant but also very friendly and helpful. They are true professionals who know what they’re doing.
Secondly, because of the Yaws users. Yaws has been used in production for years at WhatsApp (proof) and Klarna (proof). These billion-dollar companies bet on Yaws. Why shouldn’t we?
And last but not least, my own experience with it. In short, Yaws is good enough. It’s not perfect by any means. Its community is not as big as Cowboy’s. It lacks quite a few of the features you get with Phoenix out of the box. But Yaws works for me, offering a nice balance between low-level control and productivity.
7 Likes
The difference between Yaws and Cowboy is along the lines of the difference between, say, Apache and Puma. One is a full-blown traditional web server daemon that handles traditional websites (but happens to be able to be integrated into other Erlang applications). The other is a component to allow an Erlang application to listen for and accept HTTP requests.
Basically:
- If you need to setup a server to host a traditional website (static HTML pages, or maybe server-side includes or CGI), then Yaws is the right fit
- If you need to give your application the ability to communicate with clients over HTTP, then Cowboy is the right fit (Yaws can work here, but unless you want to write a Yaws adapter for Plug or forsake Plug entirely, it probably ain’t happening in an Elixir application)
Even equating Yaws to something as immense and comprehensive as Phoenix dramatically undersells the sort of stuff Yaws can do.
While we’re on the topic of Erlang web servers, there’s also MochiWeb.
5 Likes