Hacker News new | ask | show | jobs
by amorphic 2807 days ago
I used aiohttp for a small project recently and found that it to be very good.

Combined with aiohttp-json-rpc I had a very effective websocket-based JSON RPC backend service up and running in a very short time and with very little boilerplate. I'll be using this pattern again for sure.

What would have been the advantage of me using Sanic instead (I haven't RTFM for sanic yet but I'm about to...)?

2 comments

[disclosure I am a sanic contributor] aiohttp is a great project, very similar to sanic, I'd say the big thing is sanic is slightly more flask like than aiohttp in ergonomics (which is something aiohttp has been working on[1]).

Sanic also makes performance a key development goal so you can feel comfortable the project will scale gracefully. But I will stress I don't have current benchmarks to compare against aiohttp

[1]https://aiohttp.readthedocs.io/en/stable/faq.html#id1

The thing I like about Django is that it is an opinionated framework so lots of decisions were already made for me. Flask is a not too distant second place.

With aiohttp you can make neat things it is operating a level below Sanic - in my experience people end up writing their own half-baked undocumented framework based on a combination of aiohttp, some ORM and a template engine - sometimes with half a dozen combinations in the same company.