In my application, I have used flask-security to add authentication and authorization topics. SQLAlchemy is also used as the data provider (with MySQL as backend). The app is working fine.
Then, I did some MySQL tracing, and the log shows me that at every URL requested on the app, the flask-security library send two database queries:
select ... from user where user.id = 'the user identifier'
select ... from role, roles_users ...
I think this is a performance problem, and I like to minimize these queries. I don't know if there is a configuration feature I'm missing.