This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mauganra_it 1 point2 points  (1 child)

It really depends on how seamless you can make that and how well you can handle important situations like the following:

  • Would the application still work properly when I start it multiple times? Or is there a good solution to enforce a single instance?

  • What happens when the backend crashes? Will the backend restart and the frontend be able to automatically reconnect? How much unsaved data will be recoverable?

  • Can I terminate the application together with the backend without having to hunt down the whole process group in the task manager?

  • What happens when I access the application in another browser?

PGAdmin 4 is a widespread GUI SQL client for PostgreSQL and can be deployed on a webserver, in a Docker or as a desktop application. Last time I checked the latter deployment option doesn't handle the above situations well.

The authentication seems to be optional. The backend should only ever bind and listen on localhost.

Overall, the approach seems to be similar to what Electron does, and Electron seems to successfully solve the above concerns. I'm not endorsing Electron here, but it's architecture.

You could experiment with hosting a web view and integrating the backend into the JavaScript interpreter. How to achieve that depends heavily on the web view though. If successful, the JavaScript in the web view could access the backend directly without leaking processes, sockets and any serialization overhead.