官术网_书友最值得收藏!

Blackhole

This storage engine accepts data but does not store it. It discards data after every INSERT instead of storing it.

The following example shows the BLACKHOLE table process:

mysql> CREATE TABLE user(id INT, name CHAR(10)) ENGINE = BLACKHOLE;
Query OK, 0 rows affected (0.07 sec)
mysql> INSERT INTO USER VALUES(1,'Kandarp'),(2,'Chintan');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM USER;
Empty set (0.00 sec)

Now what is the use of this storage engine? Why would anybody use it? Why would we run an INSERT query that doesn't insert anything into the table?

This engine is useful for replication with large amount of servers. A blackhole storage engine acts as a filter server between the master and slave server, which do not store any data but only apply replicate-do-* and replicate-ignore-* rules and write a binlogs. These binlogs are used to perform replication in slave servers. We will discuss this in detail in Chapter 7, Replication for building highly available solutions.

主站蜘蛛池模板: 乌海市| 平和县| 赤水市| 舞阳县| 泰来县| 上林县| 桂阳县| 咸宁市| 凤翔县| 阿勒泰市| 衢州市| 北海市| 金昌市| 洮南市| 广汉市| 石棉县| 墨玉县| 长子县| 永州市| 乌拉特后旗| 平潭县| 遂溪县| 兴宁市| 平凉市| 沭阳县| 娱乐| 若尔盖县| 北安市| 南岸区| 九龙城区| 沭阳县| 淮阳县| 珲春市| 若羌县| 东乌| 秦皇岛市| 武威市| 二连浩特市| 阿克苏市| 安溪县| 茂名市|