Why is Craft extremely slow when using a shared, external database? Every now and then I work in developer teams where we all use our local development environment to work on the code, but share the same database on a remote server (like discussed here etc.).

Most of the time this will kill Crafts performance big time on our local machines. Requests take up to 30 seconds in the Control Panel and in the front-end as well. 

Does anyone else encounter the same behavior and/or has an idea how to improve that? The logs don’t explain much.

Time:   25.85331s
(index):3505 Memory: 25,723Kb
(index):3506 Total Queries: 287
...


The site on the remote server is snappy like you would expect it.
My suggestion would be to do what is outlined in Database &amp; Asset Syncing Between Environments in Craft CMS

It's a little bit of logistical organization coupled with some scripts to do the asset/db synchronization.

It's going to be much, much faster than working with a remote db... and safer, too.