Best practices for storing user data in a Streamlit app and deploying it for a variable number of users

Hi everyone,

I’m building a Streamlit app that will allow users to access several APIs like DALL-E, ChatGPT, and Whisper, by entering their API keys. However, I’m not sure how to store the data (including photos, text, and audio) and deploy the app, given that I don’t know how many users the app will have.

I want to give users the option to save and host their data on my app’s cloud. I’ve heard of using App Engine to host the app and Google Storage to store data, but I’m not sure if this is overkill for my current needs.

I’ve also considered using Firestore to store data, but I’m not sure if it’s the best option for my case. Does anyone have experience with this and can share some insights?

Additionally, I’m thinking about creating a local database at every session to store data and images in the directory. However, I’m not sure how much space I have for this. It’s okay if the data is cleared when the session is closed, but I’m curious about the limitations.

Any help and advice on best practices for storing user data and deploying Streamlit apps would be greatly appreciated!

Thanks in advance.

1 Like

By default, Streamlit runs on a single thread, which means it can be susceptible to CPU bottlenecks or memory limitations. I think the first step is to try to define the number of users to be sure that Streamlit is the correct option.

For data sources, maybe these tutorials help you to choose one

Connect to data sources

Streamlit Community Cloud has a 1GB resource limit. Here are some tips for resource-demanding applications.

Common app problems: Resource limits

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.