Schema Evolution and Foreign Keys

Foreign Key evolution at the macro level

In this line of research, we study the evolution of foreign keys in the context of schema evolution for relational databases. Specifically, we study the schema histories of a six free, open-source databases that contain foreign keys.

In [ER17, Computing 19] our findings verify previous results that schemata grow in the long run in terms of tables. To our surprise, we discovered that foreign keys appear to be fairly scarce in the projects that we have studied and they do not necessarily grow in sync with table growth. In fact, we have observed different "cultures" for the handling of foreign keys, ranging from treating foreign keys as an indispensable part of the schema, in full sync with the growth of tables, to the unexpected extreme of treating foreign keys as an optional add-on that twice resulted in their full removal from the schema of the database. Apart from the behavior of entire schemata, we have also studied the behavior of individual tables. We model the schema of any version of the history as a graph, with tables being nodes and foreign keys being edges. The union of these graphs is called the Diachronic Graph of the schema and contains all the tables and foreign keys that ever appeared in the schema history. The study of the Total Degree of tables at the Diachronic Graph, reveals several patterns. The population of tables with total degree in the range of [0-2] includes almost all the tables that were eventually removed from the schema, as well as the vast majority of survivor tables. These low-degree tables (especially the dead ones) tend to be mostly with zero or very few internal updates in their entire history. At the same time, the few tables with degree higher than 2 are typically born very early in the life of the schema, overwhelmingly survivors, and, unusually active, typically undergoing medium or high update activity.

Foreign Key evolution at the micro level with topological patterns

In [ER20] we study the evolution of tables in a schema with respect to the structure of the foreign keys to which tables are related. We organize a hierarchy of topological complexity for the structure of foreign keys, based on a modeling of schemata as graphs, where tables are classified in increasing order of complexity as: isolated (not involved in foreign keys), source (with outgoing foreign keys only), lookup (with incoming foreign keys only) and internal (with both kinds). Our study reveals that this hierarchy reflects also the update behavior of tables: topologically simple tables are more likely to have a life with few or zero schema updates, whereas, topologically complex tables are more likely to undergo high numbers of updates. Early versions of the database attract the large majority of births of complex tables, as opposed to the simple ones, demonstrating a pattern of reducing the introduction of complex, heavily updated constructs in the schema as time progresses.

Publications


Konstantinos Dimolikas, Apostolos V. Zarras, Panos Vassiliadis. A study on the effect of a table's involvement in foreign keys to its schema evolution. 39th International Conference on Conceptual Modeling (ER 2020), Nov. 3-6, 2020, Vienna.

Evolution of Foreign Keys at the Topological Level[Local page with the paper, video presentation and other material]

An 8' teaser video with just the key highlights, and a lengthier, full-fledged presentation of the paper


Panos Vassiliadis, Michail-Romanos Kolozoff, Maria Zerva, Apostolos V. Zarras. Schema evolution and foreign keys: a study on usage, heartbeat of change and relationship of foreign keys to table activity. Computing, Volume 101, Issue 10, pp 1431–1456, October 2019. 2019.

Long version of the ER'17 paper. [Official page by Springer] [Open by Springer (only for online reading)] [Local copy and supplementary material]


Panos Vassiliadis, Michail-Romanos Kolozoff, Maria Zerva, Apostolos V. Zarras. Schema Evolution and Foreign Keys: Birth, Eviction, Change and Absence. 36th International Conference on Conceptual Modeling (ER 2017), pp. 106-119, Nov. 6th-9th, 2017, Valencia Spain.

Evolution of Foreign Keys at the Macro Level[Local page with the paper, video presentation and other material]