The Thesis

Here You can find the entire thesis as a pdf file:

If you just need a quick overview of what was achieved or what still needs to be done, I’ve copied the final conclusion directly from the thesis:

Conclusion

In this thesis, a large amount of the database migration to PostgreSQL has been completed. Eccentricities of SQL Server, PostgreSQL, and the Django ORM have been encountered and documented so that future work on the project can be carried out faster and more efficiently.

The basic Schema of tables and views of the openIMIS database has been recreated in PostgreSQL in its entirety and should be able to be queried by the software with minimal additional work needed (such as quoting identifiers in SQL queries).

Functions and also a few stored procedures have been migrated to the new PostgreSQL database and the major (and minor) differences between SQL Server's implementation of the SQL language and the PL/pgSQL language have been documented so that future work in this regard can be sped up.

A data migration tool has been created for the openIMIS initiative and has been uploaded to their GitHub repositories.

The openIMIS initiative's wiki has been updated with the findings of this thesis and instructions and recommendations have been included for the team that will continue this work in the future.

Future Work

As time restrictions lead to the unfortunate reality that not all stored procedures could be migrated to the new database, an obvious step is to complete this migration by moving over the remaining stored procedures. While translating the code to the PL/pgSQL language (or any other language such as PL/Python), many small optimisations can already be performed as inefficiencies in the old code are uncovered.

As functions and stored procedures are migrated to PostgreSQL, in-application code that calls these functions may need to be adapted as some functions needed to have the order of their parameters changed (PostgreSQL wants all parameters with default values after all parameters without default values).

Completing the creation of Django model definitions for the remaining 20 database tables could speed up future migration plans and unify management of database tables. Additionally, models for openIMIS' 34 views can be created so that Django can properly interact with them.

Moving to a newer version of PostgreSQL so that procedures can be stored as actual procedures (instead of functions) should be tackled at some point. This will hopefully be very little work as both the syntax and the basic structure remain basically the same across different versions of PostgreSQL. And, unlike SQL Server, the driver for PostgreSQL seems to be version independent so that no additional works is needed there. The sooner this is done the less effort it will be.

Incorporating many – if not all – stored procedures into in-application code could further optimise real world database performance as many operations would be performed by the multitude of clients instead of the single server.

Continuing the work on the migration tool could improve its performance. Improving the code that deals with skipping historical data so that dependencies are respected may greatly improve the tool's utility, especially in real world applications when clients move their data to the new version and may wish to leave behind old data.

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/