Chapter 08 · MariaDB Storage Engines Beyond InnoDB

CONNECT and Other Specialized Engines: External Data Access and Tradeoffs

Treat CONNECT as an optional external-data access engine with package/plugin/dependency prerequisites, external failure and credential boundaries, limited pushdown, and a staged-ingest alternative when local transactional guarantees matter.

Advanced90–115 minutesCONNECT discovery + optional CSV labMariaDB Community 12.3.2 baselineOptional CONNECT plugin/packageLast reviewed: August 2026

Learning outcomes

ServiceHub receives a nightly CSV file from a field-service partner. Someone proposes “mount the file as a MariaDB table with CONNECT and join it directly in production.” CONNECT can indeed expose files and remote data sources through SQL, but this shifts file permissions, network failures, remote query behavior, credentials and consistency into the database execution path. The correct question is not “Can MariaDB open it?” but “What failure and consistency contract are we accepting?”

01

Detect whether CONNECT is packaged, installed and enabled on the exact server.

02

Explain CONNECT as a pluggable external-data-access engine, not a local transactional store.

03

Create an optional local CSV table with explicit file/path permissions when the plugin is available.

04

Reason about ODBC/JDBC/MYSQL remote sources, pushdown limits and failure propagation.

05

Protect credentials and decide when ETL/staging is safer than live federation.

Availability rule

CONNECT is optional. The shared library/package may exist without the plugin being installed, and some dependencies such as unixODBC are external. Therefore the mandatory lab begins with discovery. Installing CONNECT is optional and must follow the package/version documentation for your platform.

1. Separate “supported by MariaDB” from “installed here”

sql · discover engine and plugin state
SHOW ENGINES;SHOW PLUGINS;SELECT ENGINE,SUPPORT,TRANSACTIONS,XA,SAVEPOINTSFROM information_schema.ENGINESWHERE ENGINE='CONNECT';SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARYFROM information_schema.PLUGINSWHERE PLUGIN_NAME LIKE 'CONNECT%';

If CONNECT is absent, that is a valid result. Do not change production packages merely to complete a lesson. On Linux systems using MariaDB packages, CONNECT is commonly delivered in a separate package such as mariadb-plugin-connect, and the plugin can then be loaded with INSTALL SONAME 'ha_connect' when the library and dependencies are present. Package names and library paths are platform/version dependent.

2. Optional free/local CSV lab

Prerequisite

Run this section only on a disposable local MariaDB instance where CONNECT is installed and the server process can read a test CSV file. Put the file in a dedicated lab directory with least-privilege filesystem permissions. Never point CONNECT at arbitrary sensitive system files.

text · example CSV file
partner_id;region;open_casesA-100;north;3A-200;south;7A-300;west;2
sql · create a CONNECT CSV table
USE servicehub_engines_lab;CREATE TABLE partner_case_feed (  partner_id CHAR(8) NOT NULL,  region VARCHAR(20) NOT NULL,  open_cases INT NOT NULL)ENGINE=CONNECTTABLE_TYPE=CSVFILE_NAME='/srv/mariadb-lab/partner_cases.csv'HEADER=1SEP_CHAR=';';SELECT * FROM partner_case_feed ORDER BY partner_id;SHOW CREATE TABLE partner_case_feed\G

The path is illustrative. Containers, Windows services, SELinux/AppArmor and systemd sandboxing can all change which paths the mariadbd process can read. A successful CREATE TABLE proves that the table definition was accepted; the first scan may still fail because the file is missing, unreadable, malformed or encoded differently.

3. What the optimizer can and cannot push outward

CONNECT supports many table types, including CSV/JSON/XML files and external DBMS access through ODBC, JDBC or a MySQL/MariaDB API. For remote types, CONNECT can sometimes push predicates to the source so the remote system does more filtering. Pushdown is capability- and query-specific; do not assume every join, expression, sort or function executes remotely.

sql · plan the query before assuming pushdown
EXPLAINSELECT partner_id,region,open_casesFROM partner_case_feedWHERE open_cases >= 5ORDER BY open_cases DESC;

For a local CSV, there is no remote database optimizer to use an index; scanning the file may be the natural access method. For ODBC/JDBC sources, source indexes can help only if the generated remote request lets the external DBMS use them. Capture both MariaDB plan evidence and source-side metrics/logs when tuning federated access.

4. Failure propagation is part of query semantics

Failure What the MariaDB query may experience Design response
File disappears or permissions change Open/read error at query time. Treat file delivery and permissions as monitored dependencies; stage/validate before exposing to users.
Remote ODBC/JDBC DBMS is slow MariaDB session waits on external dependency. Set/verify connection/query timeouts where supported; isolate federation from latency-sensitive OLTP paths.
Remote schema changes Column discovery/conversion or queries fail. Version external contracts and test changes before deployment.
Network partitions Partial/failed requests and ambiguous application timing. Design retry/idempotency at the correct boundary; do not assume local transaction semantics cover the remote source.
Credential rotation CONNECT table may stop authenticating. Use protected configuration/credential mechanisms and rotate with a tested procedure.

The crucial mental model is that a CONNECT table can make an external system part of a SQL statement’s critical path. MariaDB cannot manufacture atomicity across a file, ODBC server and local InnoDB transaction merely because all objects appear in one SELECT or DML statement.

5. Deliberately wrong: embed a privileged remote password in DDL

A connection string stored in table metadata, dumps, logs or deployment scripts can expose credentials to people and systems that were never supposed to possess them. The repair is to use the least-privileged remote account, restrict metadata visibility, use platform/driver facilities for protected credentials where possible, and design rotation. If a managed secret mechanism cannot be integrated safely, a staged ETL process may be a better boundary than live federation.

Similarly, installing every optional engine “just in case” expands package, plugin and dependency surface. Install CONNECT only where its operational value exceeds the additional attack, patching and troubleshooting surface.

6. Specialized engines are contracts, not shortcuts

MariaDB supports other specialized engines such as Spider, FederatedX, ARCHIVE, BLACKHOLE and columnar/distributed offerings depending on edition, package and version. Each exists for a specific data-placement or workload model. Never transfer guarantees from InnoDB: check transaction support, locking, DDL, backup, replication/Galera behavior, encryption, failure recovery and maintenance tooling for the exact engine/version before adoption.

Production judgment

CONNECT is strongest when external data access is intentional, bounded and operationally owned. For core OLTP, a controlled ingest/staging pipeline into InnoDB often gives clearer consistency, indexing, backup and availability behavior. Live federation is justified when freshness and source ownership outweigh those costs and the failure path is tested.

7. Verification and optional cleanup

  1. Record SHOW ENGINES/PLUGINS before any install attempt.
  2. If CONNECT is available, create only the local CSV example and verify a filtered query.
  3. Rename/remove the CSV temporarily and observe the failure, then restore it.
  4. Document the server OS user and filesystem path permissions.
  5. If you installed CONNECT only for a disposable lab, follow the official uninstall/package procedure rather than deleting plugin files manually.

Check your understanding

  1. Why is SHOW ENGINES not enough to prove CONNECT is production-ready?
  2. What additional dependency may ODBC require on Linux?
  3. Why can a remote predicate be slower than expected even when the table exists?
  4. What is dangerous about embedding credentials in CONNECT DDL?
  5. When is staging external data into InnoDB preferable to live federation?
Review the answers

SHOW ENGINES proves availability, not consistency, security, backup or workload suitability. Linux ODBC commonly needs unixODBC plus a source-specific driver. Pushdown is not universal, so filtering/join work may occur inefficiently or the remote source may be slow. DDL/metadata can expose secrets. Staging is preferable when predictable local transactions, indexes, backups, availability and failure isolation matter more than querying the external source live.

Lesson 5 combines every engine into one decision framework and demonstrates the most dangerous mistake of the chapter: assuming one SQL transaction gives identical rollback guarantees across different storage engines.

8. Prefer a staging boundary when external freshness is not worth synchronous dependency

A useful architecture test is to ask what should happen to ServiceHub when the partner system is unavailable for twenty minutes. If dispatchers should keep working against the last validated feed, then a live CONNECT query puts the wrong dependency on the request path. A scheduled ingest can read the external source, validate schema and row counts, load an InnoDB staging table, perform an atomic rename/swap or versioned publish, and preserve the last known-good dataset when ingestion fails.

That staging pattern also creates clearer observability. The ingest job can record source timestamp, file checksum, row count, rejected rows, duration and validation result. Application queries then use ordinary local indexes and transaction semantics. The tradeoff is staleness: users see data as fresh as the last successful ingest rather than the remote source at query time. When that freshness loss is unacceptable, CONNECT may still be justified—but now the decision is explicit.

For remote ODBC/JDBC access, treat timeouts and retry semantics as part of the data contract. A database session waiting on a remote driver consumes local connection/concurrency capacity. Retrying a failed write can duplicate effects if the remote system committed before the network failure became visible. Therefore live write-through federation requires source-specific idempotency and failure analysis, not just a connection string.

9. Metadata discovery and schema drift deserve explicit tests

CONNECT can discover columns for some external sources, but automatic discovery is not a substitute for a versioned schema contract. A partner may widen a field, change date formatting, rename a column or introduce a delimiter that alters CSV parsing. Production pipelines should test a known sample, validate expected columns/types, reject incompatible input and preserve the previous good dataset. For remote DBMS access, compare remote metadata before deploying query changes and avoid letting driver-specific type conversion silently redefine application semantics.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only assets compatible with the Ethereum/ERC-20 network. Do not send TRC-20/TRON assets.