Show HN: A flask app to make dashboards, easily
github.com
github.com
The OP's project is also pretty cool.
But how does it compare to OP's project? Does it have more graphics choices?
https://github.com/christabor/flask_jsondash/blob/master/sch...
The big ones are d3, c3, and plotly. Those cover 99% of what you would need.
Check out the example app and endpoints app, then load the poorly.json and kitchen sink.json files into a new dashboard. I wouldn't expect anyone to make dashboards that extreme and they all render fine (we're talking upwards of 30 charts, many using webgl for 3d).
All that being said, I will continue to make this more optimized as I can.
What do flask apps do when they want a live connection to the client, or need to serve a heavy (slow) request? Communicate with a Node websocket server over a queue, and share a database?
I don't mean to disparage Flask. Their goal is to make it simple to stand up site with minimal boilerplate or bloat, and they succeeded at that.
Mind you, it could just be that I take high concurrency for granted. I build most web stuff on Node or Clojure, but now that I think about it, apps that require long quiet connections are actually not the norm.
from gevent import monkey
monkey.patch_all()Are you imagine this scenario or you are actually using Flask for long polling? What's your Flask websocket setup looks like?
FYI Flask internal does not stop you from using thousands of threads of greenlets to process concurrency. And web request-response model is embarrassingly parallel on multi-core. Just spawn one worker per core.
For a simple API service if you can not handle 3K rps per Flask instance you are doing it wrong.
As a side note, the synchronous request processing is more a consequence of Python rather than flask itself. I've personally found that I build more scalable things in Python, compared to something like node, because it lends itself to scalable architecture decisions. You can do a lot of things in node that are super convenient when you have a single server but that require major changes when you expand.
That's one of the major plus points of PHP too.
I used Nginx as a HTTP proxy and gunicorn for WSGI. It worked decently well, although it was pretty resources intensive (CPU, RAM).
Today you can use something like Caddy[0] and Gunicorn[1]
I can't say at what level it would break, but I'm confident it would perform as well as django (and it's designed to be thread safe so assuming your following the 12factor app principles And use the process model/attached storage for persistence running elsewhere, you can run multiple threads, apache vhost multi threading notwithstanding.
WSGI is partly to blame.
A web technology derived from the '93 has no place in 2016.
Flask is used in production in sites serving thousands of requests/second.
I haven't done web sockets with it - what work I've done with sockets has been in Node.
For building REST apis, it doesn't get easier, IMO. It's very straightforward, it scales well, and it's simplicity makes troubleshooting a reasonable task.
It's appropriateness for slow requests may be questionable, but before spending too much time on a more robust solution it's worth looking into why requests are slow in the first place. Cacheing, message queues, etc. are easy solutions to implement. Data store optimization is generally a quick and easy win that should be done regardless. When it gets to the point where python is the limiting factor it's easy to replace because the client facing front end is generally a proxy.
Look into uwsgi or gunicorn, and you'll never look back :)