archiver-appliance / epicsarchiverap

This is an implementation of an archiver for EPICS control systems that aims to archive millions of PVs.
Other
38 stars 37 forks source link

Added environment variable to control the name of MySQL DB #119

Closed DanielALS closed 1 year ago

DanielALS commented 3 years ago

At the ALS we are using 3 AA instances and I did not want to maintain three separate instances of MariaDB server. I have added a few lines of code to make the DB name an environment variable. This appeared to be the only feasible solution as the table names are hard coded throughout.

I've been running with this set up for a few months now without issue. In my use case I'm using the variable: ARCHAPPL_PERSISTENCE_LAYER to point to a custom class which implements this change.

Another advantage of using one DB server instance, is that I can easily create views of all three ArchivePVRequests tables using a UNION and keep my eye on what is being added. Same with the alias table.