Skip to content
Advertisement

Join my app database with database from software

I have been hurting a wall for quite a while now, I am making an application linked to a software that we are using, which will allow the user to either access data from the software with my application and update data with my application on the software.

So here is the whole idea: https://i.imgur.com/Pl4lUsm.png

So my app will be linked to the software’s database (Software Patient) with the help of foreign key (patientId on “App Patient”).

And I need to be able to search for email, password, firstName, lastName, secretStuff directly from my app and be able to update data as well on both databases.

The biggest issue here is that I can’t make a third table that merge all the data into one because the data from the software’s database (Software Patient) will be updated quite a lot directly from the software by others people.

The current stack is composed of :

  • My application: Node.js with Sequelize, GraphQL & PostgreSQL
  • Software that we use: SQL Server Express

Thank you in advance!

Advertisement

Answer

The app you are developing must get data from your commercial Software Patient (we’ll call it SP) system. That presents several questions. You really really need clear answers to these questions to finish designing the data flow in your app. Some of the questions:

  • How will your app get data from SP? Will you issue SQL queries to SP’s database? Does SP publish an Application Programmer Interface (API) for this purpose? Or a data export function you’ll use in you app’s workflow?
  • Must your app’s view of SP data be up-to-the-minute? Will an hourly update be enough? Daily?
  • Will your app change SP data, insert new data, or delete data in the SP system? If so see the first question.
  • Must you reverse-engineer SP, that is, guess how its data is structured, to make your app work? Or can you get specs / documentation from SP’s developers?
  • If you update a reverse-engineered database, dude, be careful!

If your app will use SQL to get data from SP, it will send that SQL to SP’s SQL Server Express database. nodejs has tooling for that, but both the tooling and the SQL dialect used in postgreSQL are different. Maybe it would be wise to use SQL Server throughout: doing so reduces the cognitive load on people who will maintain and enhance your app in the future. Neither they nor you will have to keep straight the differences between the two DBMSs.

If you’ll use an API, great! That’s a clean interface between two systems. (It will probably have some irritating and confusing bugs, so allow some time for that. I’ve had to send pull requests to several API maintainers.)

If you figure out the answers to these sorts of questions, you’ll make a good decision about your question of the third table. It’s impossible to address your specific third-table question without some of these questions.

And. Please. Don’t forget infosec. You have a duty to keep personal data of the patients you serve away from cybercreeps.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement