- 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.
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- 編程卓越之道(卷3):軟件工程化
- Mastering Swift 2
- Learning ELK Stack
- 人人都懂設(shè)計(jì)模式:從生活中領(lǐng)悟設(shè)計(jì)模式(Python實(shí)現(xiàn))
- 從0到1:Python數(shù)據(jù)分析
- SQL Server從入門到精通(第3版)
- UVM實(shí)戰(zhàn)
- 編程菜鳥學(xué)Python數(shù)據(jù)分析
- SQL Server數(shù)據(jù)庫管理與開發(fā)兵書
- Kotlin開發(fā)教程(全2冊)
- Geospatial Development By Example with Python
- Fast Data Processing with Spark(Second Edition)
- C++程序設(shè)計(jì)教程
- HikariCP數(shù)據(jù)庫連接池實(shí)戰(zhàn)