(Originally posted in kinja ops blog)
When you have to drop a large database, you’ll encounter some problems, mainly replication lag. Now I’ll show you how to avoid this.
What can cause replication lag when you drop a database? First, it takes some disk I/O to unlink the files, and secondly MySQL will scan through the buffer pool to see if there are pages from that database or not. On a huge (or at least big) database this could take seconds or even minutes, what means your slaves will collect lag for seconds or (of course) even minutes.