BLACKHOLE

The BLACKHOLE storage engine accepts data but throws it away – no data is ever stored, and retrievals always return an empty result. See Storage Engines for how it compares to the others.

Because writes to a BLACKHOLE table are still recorded in the binary log, it is used as a lightweight relay in some Replication topologies: a server can be configured to write all events through a BLACKHOLE table purely to forward them downstream, without duplicating the data locally. It is also occasionally used to benchmark server overhead independent of storage cost, since writes complete without any actual persistence work.

FeatureBLACKHOLE
Storage limits0 (no data is stored)
TransactionsNo
Locking granularityTable
MVCCNo
Geospatial data type supportYes
Geospatial indexing supportNo
B-tree indexesNo
T-tree indexesNo
Hash indexesNo
Full-text search indexesNo
Clustered indexesNo
Data cachesNo
Index cachesNo
Compressed dataNo
Encrypted dataNo
Cluster database supportNo
Replication supportYes
Foreign key supportNo
Backup / point-in-time recoveryN/A (no data to back up)
Query cache supportNo
Update statistics for data dictionaryNo

CREATE TABLE relay_events (
    id INT AUTO_INCREMENT PRIMARY KEY,
    payload JSON
) ENGINE = BLACKHOLE;

-- The insert succeeds and is written to the binary log, but no row is stored
INSERT INTO relay_events (payload) VALUES ('{"type":"order_created"}');

SELECT COUNT(*) FROM relay_events; -- always 0

Query OK, 1 row affected
COUNT(*)
0