Cowboy only vs Plug and Cowboy

I used cowboy initially but then i had to drop it because it did not provide CSRF protection functionality that is provided by plug in phoenix framework . My doubt is that instead of using phoenix, can’t i go for plug+cowboy app. Also, what are the differences when we use cowboy only app vs cowboy+plug app?

what are the differences when we use cowboy only app vs cowboy+plug app?

Performance-wise, almost no difference.

2 Likes

I believe phoenix is too much for my project. Will i face any performance or functionality lows when i choose plug+cowboy instead of phoenix?

It depends on your project, I think.

Will i face any performance lows

Probably not, since plug+cowboy is usually a bit faster than phoenix+plug+cowboy.

Will i face any functionality lows

If you don’t plan to use channels, controllers, live reload, some browser-specific stuff like html templates and js task runners (brunch), then also probably not.

If you plan to write a web service, and not a web app (whatever that means), then both plug and phoenix will do nicely. I tend to pick plug in such cases though.