Run MySQL in memory with slave for persistence

1.7k views Asked by At

Let's presume that I need to maximize my write performance and am willing to take a risk of a few minutes of lost data. My use case is a "burst" of activity for a few hours which will subside. The workload is append-heavy.

Let's presume, for the sake of argument, that the data is not so urgent that a few minutes of lost data will cause as many problems as a slow server. For reasons beyond my control, the master must run on EC2, so disk speed could be an issue.

My potentially crazy idea is to have an a master database that runs entirely in RAM (either as a MEMORY table or as InnoDB backed by a RAM disk) and then replicate to a slave for slightly delayed persistence. What will go wrong?

1

There are 1 answers

0
Stephen Corona On

Just use InnoDB with a huge buffer pool and set innodb_flush_log_at_trx_commit=2 or 0. It's pretty much what you're describing.