Automatic MEMORY tables sync in replication
Using MEMORY tables in MySQL is very useful; they are stored in memory and they are usually not so big in order to avoid a huge utilization of RAM. They are very fast.
MEMORY tables are often used to store session user data, chat messages and to store small frames of data from a bigger table in order to achieve great performance.
But, if you use them in a replication environment, you can have some problem due to their “volatility”; MEMORY table rows are lost when the server shuts down.
If you restart a slave host for some reason or after a failure, you will have empty MEMORY tables on it, while the master host will have the correct ones. 继续阅读