Yaron
Yaron

Reputation: 1965

Best practice - Developing on a local mysql server / RDS?

I am developing a Drupal site using MariaDB.

The import process of a 77MB dump file locally (docker container running maria db) takes about 2 minutes. The same import to an Amazon RDS (db.m4.large) running a MariaDB database takes more than 30 minutes.

Isn't the Amazon RDS supposed to be quicker ?

What is the recommended practice for having a quick dev environment for SQL ? (the local docker service is running too slow)

Thanks, Yaron

Upvotes: 1

Views: 569

Answers (1)

Gidon Wise
Gidon Wise

Reputation: 1916

If you are already on RDS, just use a snapshot.

  1. Take a snapshot from production. (or find one of the automated snapshots)
  2. Create a new DB from the snapshot

It's very fast and doesn't have the issues of latency and running millions of queries which an import has.

However, this is just one very crude approach to making a dev environment.

Some people have scripts that create the data sat for DEV from scratch. This might be more appropriate and even necessary, if for example you have a large database and developers that like to work locally on their computer.

Some people have scripts that sanitize DEV to eliminate sensitive and personal data, which you could run after the snapshot.

Some people even have DEV as a replica of the main DB and modify the DEV db so that additional usage doesn't clash with the replicated changes. This is a bit delicate though.

Often Dev and Tests use dummy data, and Staging uses real data (cloned from Production and possibly sanitized).

Upvotes: 2

Related Questions