Open wdbm opened 4 years ago
The main difference is that Sanic is asynchronous (and so able to handle much more requests concurrently). If you know Flask it should be intuitive, the API is super similar (I think they were basically trying to make an asynchronous and slightly more modern version of flask).
BTW - apparently you can also deploy Sanic apps on Gunicorn servers (https://sanic.readthedocs.io/en/latest/sanic/deploying.html).
The Flask server is not secure for production and it should be used only really for experimentation and such.
I'm talking solely about Gunicorn, which is asynchronous, as I understand it, and you can specify just how asynchronous you want it to be.
So, for example, you could try to access one of my sites from multiple machines to demonstrate this: https://www.wdbm.pro/ovipositor
Sanic might well be better, but deciding on one would be good and then we stick with it. Here's a quick comparison I found (don't take it as a representative comparison, just one I found with really quick search):
https://stackshare.io/stackups/gunicorn-vs-sanic
@Lacico What do you think?
Mostly I'm just glad a Python-based server is being used, haha, but I've been using a mix of Flask Python apps with a Gunicorn server. I'm delighted to learn of this Sanic server.
Only if someone has the time to answer, how do servers like Sanic compare with Gunicon(/Flask)?