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

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.

主站蜘蛛池模板: 莎车县| 雷山县| 宝应县| 长泰县| 佳木斯市| 长阳| 贵定县| 洛浦县| 鄢陵县| 自贡市| 勃利县| 阿坝县| 黄骅市| 齐河县| 米脂县| 凤台县| 钦州市| 成都市| 嘉义市| 广平县| 扎兰屯市| 兴国县| 安平县| 乳山市| 宜阳县| 江阴市| 建德市| 桦南县| 德令哈市| 本溪| 平安县| 新蔡县| 保定市| 永定县| 泽普县| 通州市| 株洲市| 秦皇岛市| 卓资县| 大埔区| 乌鲁木齐县|