Dec 8, 2011
tom

How do I quickly create new instances of complex MySQL database?

Question

I’m managing an enterprise web application that uses Amazon’s RDS as our database server. Our architecture is such that when a user signs up for a new account we create a brand new database for them in RDS.

The database has around 63 tables, most of which have indexes, and almost all have foreign key constraints. Currently we’re creating each new database by executing a large set of sql statements. This takes on average 57 seconds.

Does anyone have any ideas for how I could do this quicker or more efficiently?

Answer

You might want to try and execute the query as a “bulk transaction” to skip the verification checks. Be warned, this can create duplicate indexes & break consistency checks if you’re not careful.

Related posts:

  1. How to create a local backup of a remote Amazon RDS MySQL database?
  2. How to create empty database from existing one (Mysql)
  3. Bulk create thousands of mysql database giving errors
  4. mysql – grant create AND all privileges on user own database
  5. mysql create database and user script

Leave a comment