How to create models if I am using various types of database simultaneously?
It's not an efficient model, but this would work:
You can write three different APIs (RESTful pattern is a good idea). Each will be an independent Flask application, listening on a different port (likely over localhost, not the public IP interface).
A forth Flask application is your main application that external clients can access. The view functions in the main application will issue API calls to the other three APIs to obtain data as they see fit.
You could optimize and merge one of the three database APIs into the main application, leaving only two (likely the two less used) to be implemented as APIs.
I have a flask application which use three types of databases - MySQL, Mongo and Redis. Now, if it had been simple MySQL I could have use SQLAlchemy or something on that line for database modelling. Now, in the current scenario where I am using many different types of database in a single application, I think I will have to create custom models.
Can you please suggest what are the best practices to do that? Or any tutorial indicating the same?