I have a dash application that is serving 3 “departments” of approximately 15 pages.
Is there a ‘best practice’ approach, or any approach, to enable multiple servers/backends to serve pages for a single frontend? This is mostly for load management and the ability to ‘take down’ only parts of the app (not the whole thing), and not for redundancy.
I do realise this may be a niche use case however as dash is stateless, I figure this should be possible?
Hi @Inci – given the production use case you’re looking into, you might consider reaching out to our sales team about Dash Enterprise, our development platform and hosting solution for Dash applications.
Even if Dash Enterprise isn’t the right tool for the problem you’re trying to solve, it’s worth reaching out directly to get more information from the team directly on the best strategies for production-grade hosting solutions for Dash apps that will be resistant to and load or scaling issues.
You can learn more about scaling Dash applications in production on Dash Enterprise in our docs here: Scaling Your App | Dash for Python Documentation | Plotly, and even if you decide to host your project outside of Dash Enterprise, this information may still be relevant and help clarify some of your questions about how the stateless nature of the Dash framework impacts scaling and server load.
We do this with our software through a reverse proxy and multiple gunicorn servers. We have a main app that runs on the base url ‘/’ and then several servers that are accessed through various path names. The key is setting up the NGINX server to appropriately direct traffic to the gunicorn servers and further to make sure that the url_base_pathname is correct.
For example… we have a server running behind ‘/auth/insights/’, in order for that Dash app to serve the appropriate files and such we set url_base_pathname=‘/auth/insights/’ with this server. You can repeat this approach as many times as you want (as far as I can tell and of course limited to performance of the machine it’s on).
There’s a little more to making sure python modules and data is available across all servers but nothing terribly complex.
Thanks @nathandrezner - it’s definitely something we’re considering. The “Enquire for price” has probably been a bit of a friction point for us honestly, but is still on our radar.
We’re currently running an nginx and never thought of doing what you suggested - seems like a great approach. Lets us reload only the parts of the application we need.