Picture of Adrian 6765
Registered 1 year 230 days
Adrian 6765 Wednesday, 16 August 2023, 10:48 AM
External database connection
Hello!

First of all: I'm new to programming.
I'm trying to connect our external SQL server to a myApps app. How can i do that and do I have to implement the websocket to the app services? It's not that intuitive to me.

BR,
Adrian
Andreas Fink
Moderator Registered 13 years 43 days
Andreas Fink (innovaphone) Tuesday, 22 August 2023, 10:55 AM
Re: External database connection
Hello Adrian,

in our solution we use WebSocket for communication between the components (https://sdk.innovaphone.com/13r3/doc/appdevelopmentguide.htm).

My suggestion therefore is to implement a middle-ware on the external SQL server that connects on one side via WebSocket to the App Service and implements a custom JSON API, and on other side connects to the SQL server.

The middle-ware would translate JSON messages to SQL queries and vice versa. For example:

{api: "MyExternalSQL", mt: "GetUserId", name: "bob" } -> SELECT id FROM users where name='bob'; -> {api: "MyExternalSQL", mt: "GetUserIdResult", id: 123 }

This could be done on the external SQL server or other host using NodeJS.

On the innovaphone App Service side the JSON API would be handled using JsonApi Library that can accept incoming WebSocket connections.

Best Regards
Andreas Fink
← You can define your color theme preference here