Hacker News new | ask | show | jobs
by brut 3288 days ago
I find that I waste too much time doing "front-end" development - CSS, HTML, JS all slow me down. I am trying this right now! Thank you :)

What is the performance of this when many users at once are consuming the same app/resources?

3 comments

The performance of the app will largely depend on the analytic code that you are running inside the Dash callback functions. A few things to note:

- The dash docs (https://plot.ly/dash) are itself a Dash app. They're getting a lot of traffic today with the launch and they're holding up OK to hundreds of active users.

- The state of Dash apps is entirely in the front-end (in JS in the web browser). The Dash app backend (the python part) is really lightweight - it's a flask server (that you run with an application server like gunicorn) that dispatches to the functions that you decorate. If your functions are really resource-intensive (in memory or if they block for a long period of time), then the app's performance will suffer as part of that. However, since this analytic code is scoped inside a function, the memory will free up after the request is done.

- Since Dash's callbacks are functional, you can pretty easily add caching. Caching will store the previously computed values and serve them if the input arguments are the same. There is some more info in the "performance" section of the docs: https://plot.ly/dash/performance

    The state of Dash apps is entirely in the front-end
Cool! I develop APIs using Flask so that's good news for me. I want to keep the API as lean as possible. I also try to cache everything I can or simply render stuff into static data if possible. I.e., some data are updated on a regular basis but do not change so rapidly and thus I can just use a Jinja2 template with some {% raw %} blocks to render my jinja2 templates with much less stuff to do, or even static html when I can.

Installing as we speak.

The deployment / scalability story is the biggest weakness of Shiny (in part due to vagaries of R in production settings). RStudio has done some amazing stuff to make shinyapps.io work reasonably well, but I do feel like there are still some inherent weaknesses to the deployment process.

And for the record, I'm not knocking RStudio / Shiny here—the tooling and end-user experience is really excellent. I do worry about the ability to create "enterprise scale" apps though. Fortunately, there are a lot of times when a Shiny app is plenty.

I'll be very curious to see how Dash compares in this regard.

I have to agree with you. We needed JS developers to present our UI to be more reactive/realtime. I am trying this out to see whether we can use Dash 100% without any Angular 2/React code.
Let me know how it goes! One of the cool things about Dash is that if you need to fallback on React code for building components, you can. Here are the docs on building your own components: https://plot.ly/dash/plugins. I imagine that some large teams may have 1 or 2 JS developers that build reusable components that the rest of the 100 analytical python components could use for their day-to-day app development / exploratory data analysis.