We performed a major update which also required a database migration script to be run. This was the first time that we used a new database migration and versioning library. When the application code was deployed and the database migration script was run.
The downtime was caused due to the large number of updates performed by the migration script. The script essentially caused the database to deny service to other requests.
In future, all database migration scripts must be throttled as to only take a maximum of 60% of database resources.