MariaDB Spatial Reader/Writer

Licensing options for this format begin with FME Professional Edition.

This format replaces the MySQL Reader/Writer. It still uses terminology specific to MySQL, since MariaDB is known to work well with MySQL Servers.

Compatibility

MariaDB is a binary drop-in replacement of the same MySQL version. For example,

  • MySQL 5.1 is compatible with MariaDB 5.1, MariaDB 5.2, MariaDB 5.3
  • MySQL 5.5 will be compatible with MariaDB 5.5

This chapter uses the MySQL. For detailed information, see MariaDB Versus MySQL: Compatibility.

MySQL Overview

The MySQL reader and writer plug-in enables FME to read and write both attribute and geometric data stored in a MySQL®1MySQL is a registered trademark of MySQL AB in the United States, the European Union and other countries. database. MySQL is a well known DataBase Management System (DBMS) that provides various types of tables for different database applications. Version 4.1.0 and above MySQL databases are spatially extended to incorporate the Open GIS Consortium Simple Features Specification for simple geometric features.

There are two versions of the reader and writer:

  • MySQL which includes the spatial extension and supports geometry features, and
  • MySQL_DB which is an attribute-only version that ignores geometry.

Currently the table types that can be read are MyISAM, InnoDB and MEMORY. Note that only MyISAM tables currently support geometry columns.

The MySQL reader and writer are specifically designed to handle the geometric portions of the data when present and are optimized for non-geometry or attribute processing when no spatial columns are present. The MySQL reader and writer communicate directly with the MySQL C API interface for maximum throughput.

This chapter assumes familiarity with MySQL, the table types, column types, OGC geometry types, available server daemons, indexing mechanisms and connection parameters.

Please note that MySQL functionality that only exists in the MySQL road map and not in practice such as integration of the Spatial Reference Systems (SRS), spatial metadata tables, spatial operators, server side cursors and views were considered but are not currently integrated into the MySQL reader for FME.

Reader Overview

FME considers a MySQL dataset to be a database containing a collection of relational tables, and a table to be an FME feature type with each row corresponding to at least one FME feature. In the case of geometry collections, a single row may become more than one FME feature.

Tables schemas must be defined in the FME workspace before they can be read and can consist of both geometric and primary column types, however, only one geometry column is read per table while others are discarded.

Arbitrary WHERE clauses and joins are fully supported, as well as an entire arbitrary SQL SELECT statement. The basic reading process involves opening a connection to the database, querying metadata, and querying data. The data is read by submitting SQL queries and parsing the returned result sets.

If null geometries are read, they are treated as non-geometry features and the attributes are preserved.

Writer Overview

The MySQL writer module stores both geometry and attributes into an MySQL database. The MySQL writer provides the following capabilities:

  • Transaction Support: The MySQL writer provides transaction support that eases the data loading process. Occasionally, a data load operation terminates prematurely due to data difficulties. The transaction support provides a mechanism for reloading corrected data without data loss or duplication. Performance can also be improved by reducing transactional overhead for multiple small queries such as inserts.
  • Index Creation: The MySQL writer can set up and populate indexes as part of the loading process. By default, a spatial R-Tree index is created on the primary geometry column of a table and not on any other columns. Additional columns can be individually indexed. Composite column indexes are not supported at this time.
  • Insert Binding: By default, the MySQL writer uses prepared statements and query parameter binding ensure speedy data loading.