Can OpenLMIS run on MySQL?

As of OpenLMIS 3.0 released in 2017, OpenLMIS only officially supports PostgreSQL, not MySQL/MariaDB.

The Java Spring codebase uses Hibernate to abstract a lot of the direct database interactions. So theoretically it could be feasible to switch to MySQL without a lot of code changes. That said, there are a few caveats:

·         The code and business logic relies on Transactions, and MySQL supports those differently than PostgreSQL. So you could get subtle problems with MySQL.

·         The code does have some direct SQL statements in it (in the Repository layer of the Java Spring apps), and those SQL statements are only guaranteed to comply with the PostgreSQL flavor of SQL. OpenLMIS has not been tested with MySQL.

·         The OpenLMIS Community is hoping to expand into using PostGIS to store geographic data. We are not aware of a direct MySQL equivalent to that. So a lot of powerful spatial/GIS functionality would not be available in the future if you were tied to MySQL.

All that said, the PostgreSQL is wrapped inside a Docker container, so you might be able to easily run it with PostgreSQL without the worries of installing or configuring PostgreSQL, as long as you have Docker. In addition, it is a micro-service architecture, so if you are writing a new micro-service to add functionality, you could choose any database of your liking for the functionality you add.

OpenLMIS: the global initiative for powerful LMIS software