Changing to an Oracle database - v22-appfactory/appfactory-wiki GitHub Wiki

Purpose:

Due to uncertainty in the eventual deployment environment of Appfactory, there has been discussion about possibly needing to switch to a different database engine. This page attempts to record what information has been gathered so far about the work needed to facilitate a change in databases.

Challenges:

Before discussing the specifics of the work required it will be helpful to discuss some of the challenges that will be faced when setting up a development environment.

Currently, Oracle does not provide support for their database on ARM CPUs (i.e. M1 MacBook) or Apple OS. However, it is possible to run Oracle database as a container in Docker when emulating an x86 CPU using a program called Colima . This approach does result in a slower running database instance.

In order to make calls to this database, Oracle's Instant Client software is necessary but does not run natively on the M1 Macbook and will need to be run using Rosetta.

To connect the database instance to the Node.js project (Appfactory Services) the node-oracledb package must be installed. This package also will not run natively on the M1 chip and requires that an x86 version of Node.js be run through Rosetta. More details can be found on the Oracle database install page.

Areas of focus:

The following list represents where the majority of the work that is needed will happen.

  • node-oracledb (npm package)
  • Switch to a supported ORM
  • Rewrite database functions
  • Migrate existing data
  • More research