MENU
FEDERATED
The FEDERATED storage engine accesses data on a remote MySQL server without using replication or cluster technology. No data is stored in the local table; querying a local FEDERATED table transparently pulls the data from the remote (federated) table on demand. See Storage Engines for how it compares to the others.To enable FEDERATED, the server binary must be started with the --federated option.
| Feature | FEDERATED |
| Storage limits | Depends on the remote table's engine |
| Transactions | No |
| Locking granularity | N/A (delegated to the remote server) |
| MVCC | No |
| Geospatial data type support | No |
| Geospatial indexing support | No |
| B-tree indexes | No |
| T-tree indexes | No |
| Hash indexes | No |
| Full-text search indexes | No |
| Clustered indexes | No |
| Data caches | No |
| Index caches | No |
| Compressed data | No |
| Encrypted data | No |
| Cluster database support | No |
| Replication support | Yes (locally – the remote server replicates independently) |
| Foreign key support | No |
| Backup / point-in-time recovery | No (back up the remote table on its own server) |
| Query cache support | No |
| Update statistics for data dictionary | No |
-- On the remote server: an ordinary table to expose
CREATE TABLE remote_db.customers (
id INT PRIMARY KEY,
name VARCHAR(100)
) ENGINE = InnoDB;
-- On the local server (started with --federated): a table pointing at it
CREATE TABLE local_customers (
id INT PRIMARY KEY,
name VARCHAR(100)
) ENGINE = FEDERATED
CONNECTION = 'mysql://fed_user:password@remotehost:3306/remote_db/customers';
-- Queries against local_customers transparently hit the remote table
SELECT * FROM local_customers WHERE id = 1;