Open pharr117 opened 11 months ago
Work had started here: https://github.com/DefiantLabs/cosmos-upgrades/tree/feat/production-ready-build
This was a very quick v1 of a possible reader/writer split that was working with a shared a FileSystem cache between the two workers with an example Docker Compose build linking the 2.
A more complex setup with an underlying database layer replacing the FileSystem cache may be a better move.
The application is currently reliant on the Flask development mode setup since data is gathered and stored in single-process available Python global maps.
Flask is meant to be run behind some server type (sometimesa WSGI, gunicorn being one example). These servers spin up multiple instances of the Python program to help with load balancing and app runs.
The application data system is not prepared for this. Each gunicorn process would have its own global data store, meaning the app would be bashing RPC servers on a per-worker basis.
The application needs to be moved to a more production-ready state. One way would be to implement application modes for reader/writer process splitting such as:
A production deployment would then look like: