Using Streamlit for Analytics

Hi All!

Our team is considering using Streamlit to build an internal analytics dashboard. The plan is to connect to our Firestore database, perform complicated queries, read/write data, make visualizations, do some statistical analyses, and allow all team members to access this. I used Streamlit sometime around last year, and as far as I remember, there were some limitations with regards to performance and concurrent usage. I’m not sure how much things have changed now

The prevalent use case for Streamlit appears to be for building quick ML prototypes with static csv files. Since that’s not exactly our plan, I’m curious to learn if anyone else in the community has used Streamlit to connect to other databases, track internal metrics, customer journeys, etc.
If so, what things would you suggest we keep in mind before we start building this, and what limitations should we be aware of?

The reason we’re considering using Streamlit for this is because it’s fast and easy to set up; We’re a small dev team at a small startup so dev speed is important; Google Analytics is helpful but only in a limited scope; non-tech team members can also use it for analyses.

Any thoughts and suggestions are welcome!

Hi @mali13

I’ve set up a couple streamlit dashboards that get their data from databases. I host the dashboards inside JupyterHub using ContainDS Dashboards. Works really well and never have had a problem with concurrent users. Perhaps @danlester can advise a bit on the concurrency aspect?

Further I would advice to cache the read/GET operations on the database/API where possible as this can slow your dashboard down. Don’t have a lot of experience with costumer journey’s, so perhaps someone else can share their experience, if any.

As you point out the development with Streamlit is very fast and you can have a proof of concept within a few hours. So you could quickly check if you are happy with the performance and how the other items you mentioned would work in a streamlit dashboard :slight_smile: .

3 Likes

I remember a couple of bugs a while ago about concurrent users, but I’m sure things have improved since then.

In general, I agree Streamlit could be great for an internal dashboard that you want to develop quickly. If you are basically just slicing data based on UI controls, Streamlit will do that well.

In any case, connecting to the database shouldn’t worry you - if you can do it in Python, then you should be able to bring that into Streamlit code.

For performance, you will certainly need some tricks such as st.cache, and Python in itself isn’t top of the list for speed - but it should be good enough for an internal analytics dashboard.

But I would also love to hear from anyone who’s used it exactly for this kind of purpose!

3 Likes

I have an example dashboard running here. It may take a few moments to fire up. Code is available on my GitHub repo.

HTH

1 Like

Hey @mali13,

I hope those examples were helpful. Since you stated your looking to build dashboards with your team for a business role, the coming Streamlit for Teams might be something that’s useful for you.

It’s currently in closed beta and the plan is to launch it this year. But if you are looking to get updates you can sign up here: For teams • Streamlit

or if your looking for more detailed info now, feel free to email me and we can chat about your specific use cases! marisa@streamlit.io

Happy Streamlit-ing!
Marisa

1 Like

Hi @mali13,

there’s also an article on the Streamlit blog about connecting to a Firstore database, maybe that’s helpful for you, since you mentioned you have a Firstore database: Streamlit ❤️ Firestore

Cheers, Johannes

2 Likes

@mali13 Thank you for creating the awesome tool of streamlit analytics. I do get an error when viewing my analytics page on the latest version of streamlit (I think 84 or 85). It shows the features that recently came out of beta an an error. Is this a known issue?

Thanks