I don't think a providing a Compose file will necessarily help here. If you paginate the Mongo response, that'll help page load times
Otherwise, to distribute database load, you need to simply need to add more Mongo and Python containers. To handle web server load balancing, add a reverse proxy. You can refer to the replicas option in the Compose spec if you want to do that easily, otherwise, simply copy paste the same services
Worth mentioning that Elasticsearch is the more common tool for search results than Mongo
I am trying to write a scalable app using python and docker and mongodb
The app just runs a web search and returns a list of web pages
I then store this list in a mongodb collection using dictionary
I also have created a simple docker file that exposes the python entry point
I now would like to understand how to make a docker compose file so that I can scale the app, e.g. “my 10 million users” want to make more searches and return more values (at the moment I am limiting the search to 10 results).
Please can you advise?
Scalable dockerized Python web search with storage