sashaafm

sashaafm

Yaws vs. Cowboy (and Phoenix)

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:

  1. 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.

  2. 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?

Most Liked

evbogdanov

evbogdanov

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.

OvermindDL1

OvermindDL1

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. :slight_smile:

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. :smiley:

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. :slight_smile:

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. :slight_smile:

YellowApple

YellowApple

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.

Where Next?

Popular in Discussions Top

PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13924 124
New
crispinb
On reading dhh’s latest The One Person Framework it strikes me that Phoenix with LiveView is already pretty much this. However, never hav...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement