Skip to content

Change Database Engine

Bordi Tamás edited this page Aug 16, 2023 · 5 revisions

By default this reference implementation of Arrowhead FW provides MySQL database engine connector, however the source code itself is written to be database-agnostic. This means that you can switch the underlying database without changing much of the code.

1) Change the database connector dependency

Change this dependency definition in the root pom.xml.

<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>${mysql.jdbc.driver}</version>
	<scope>runtime</scope>
</dependency>

to MariaDB

<dependency>
	<groupId>org.mariadb.jdbc</groupId>
	<artifactId>mariadb-java-client</artifactId>
	<scope>runtime</scope>
</dependency>

to PostgreSQL

<dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
	<scope>runtime</scope>
</dependency>

2) Change the system configurations

Change the following properties in the src/main/resources/application.properties configuration file in case of each core system.

spring.datasource.url=jdbc:mysql://<address>:<port>/<database-name>  
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect

to MariaDB

spring.datasource.url=jdbc:mariadb://<address>:<port>/<database-name>  
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect

to PostgreSQL

spring.datasource.url=jdbc:postgresql://<address>:<port>/<database-name>  
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

3) Build the project

Install maven 3.5+ building tool if not yet done.

Run the mvn clean install -DskipTests command from the root folder of the project and find the new executable .jar files under the <core-system>/target folder after the build process.

ABOUT

GETTING STARTED

Certificates

Quick start

How to contribute?

HINTS

MANDATORY CORE SYSTEMS

Service Registry

Orchestrator

Authorization

APPLICATION SYSTEMS

SUPPORTING CORE SYSTEMS

Gatekeeper

Gateway

Event Handler

Choreographer

Quality of Service Monitor

Certificate Authority

System Registry

Device Registry

Onboarding

Data Manager

Time Manager

Plant Description Engine

HawkBit Configuration Manager

Device Hub

Clone this wiki locally