(One of my summaries of the 2025 pycon.de conference in Darmstadt, DE).
Full title: you don’t think about your streamlit app optimization until you try to deploy it to AWS
Streamlit is a quick way to show your models/data to stakeholders.
She once made a streamlit app to exercise writing Japanese characters. It used some character recognition model. But… the way streamlit works, it normally downloads the model every single time. For some local testing, it is probably OK, but if you put it in production… In production, network traffic might cost money.
Solution? You can cache it with streamlit, but you can also download it when building the docker image and store it inside the image and load it from there.
On to authentication. You can handle everything yourself as data scientist: login widget, auth logic, user privs, etc. You can also use an external provider like Amazon Cognito. Then you only have to hook up cognito in your code, but the OPS engineer has to set up cognito for you.
On to security. For all of them you’ll need the OPS engineer, probably.
Set up https with Route 53 and TLS certificates.
Configure CloudFront to protect against DDoS attacks and improve performance.
Use AWS web application firewall to block malicious traffic.
On to credential storage. You can use AWS secret manager instead of putting API_KEY =
"1234abcd"
right in your code. Using the secret manager is much more secure and that
will make your OPS engineer happy.
Photo explanation: random picture from Darmstadt (DE)
My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):