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

  • MySQL 8 for Big Data
  • Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
  • 169字
  • 2021-08-20 10:06:11

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.

主站蜘蛛池模板: 湛江市| 康定县| 吉安县| 灵台县| 建湖县| 临泽县| 静海县| 云和县| 南安市| 万源市| 宜昌市| 上栗县| 涞源县| 萨迦县| 梧州市| 蓬莱市| 元朗区| 精河县| 上杭县| 河间市| 霍林郭勒市| 新巴尔虎左旗| 卓尼县| 会同县| 乌拉特中旗| 遵义市| 湖口县| 孟村| 汽车| 祁东县| 咸阳市| 穆棱市| 上蔡县| 蒲城县| 鄂托克前旗| 车致| 宁国市| 万源市| 大竹县| 永州市| 武义县|