Print This Post

Transfer and Transaction Models

When GML was first developed, many people thought of it as another kind of "shape file", that is something supporting the transfer model for geographic data. By transfer model I mean the movement of geographic data from one system to another using files. While GML does in fact support the transfer model, and can do so better than most transfer formats, this was never the real reason for its development – GML was created to support geospatial transactions on the Internet.

In the transfer model, the exporter has no knowledege of the schemas of the intended target. A schema can, and usually is constructed from the data source, and data conformant with this schema is written to the transfer file. Usually the eschema, if explicitly recorded, is carried along with other transfer "metadata" in the file header. In the case of GML there is no header to speak of, however, more or less the same ideas apply. The data instances refer to the schema to which they conform. Additional metadata for the transfer could then be encoded in this application schema.

The chief benefit of the transfer model is that it captures the exported data regardless of the intended transfer target. Since many transfer formats are binary they may be smaller (sometimes a lot smaller) than uncompressed GML data used in the transfer fashion. I can thus send you an export of data about some subject without having any knowledge of your system or data schemas.

The negative aspects of the transfer model are also fairly clear. Suppose 6 features out of 100 change in some area of interest. I can export these 6 features into a transfer file. Perhaps only some properties of these features have changed. Nonetheless I need to transfer all 6 features at a minimum since I typically have no way to encode updates or inserts in my transfer syntax. We will show how this can be done using the OGC WFS protocol in the following article. In many cases it is not so convenient to determine that 6 features have changed and as a result I send all 100 features. So very often the transfer model leads to a much larger amount of data being transferred than with the transactional model.

When I get to the point of loading these into the target system I now have to match these features to features in the target system. This may require schema-based data translation since the source and target schemas can be very different. Quite often this is a manual process and sometimes fairly prone to introducing errors. If the transfer scheme allows me to select and transfer only the changed features then things are not too bad. If it does not I may need to overwrite the complete set of features (e.g. the 100 in our example).

Clearly the transfer model can be quite slow, require manual intervention and is prone to the introduction of errors.

In the transactional model, data is transferred from one system to the other using database transactions. This is the method employed with the OGC Web Feature Service. A transaction is a message that is transferred from one system to the other and which requests the receiving system to modify its data store in a specific way as requested in the message. Furthermore the actions of the receiver must be carried out in accordance with the usual rules that ensure the integrity of such transactions, namely that they are atomic, consistent, isolated and durable. It is the responsibility of the interacting servers to ensure that these characteristics are maintained.

GML supports the WFS transaction by providing a data description capability used in formulating the request, and as a transport for the returned data (e.g. for read operations that return data). Note that it is for this reason that GML provides a rather rich expression capability for database schemas. Any relational-spatial schema can be expressed in GML and GML together with the WFS protocol can tus express requests against any such database.

Support for the transaction model means that GML/WFS can actually be much faster than "conventional" transfer models – but it requires an adjustment in your thinking. Are you ready for it?

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>