1

We are planning on building a desktop application with a few web components. I want to know how resilient is this architecture.

Essentially the design looks like Architecture

  1. Mixing web components with desktop applications is possible, but the backend server is running on localhost. Is this a good idea?

  2. ZeroMQ is a distributed queuing system for message handling. The processor which is a subscriber picks up messages, processes them and pushes the results back to the queue. Subsequently, the backend again picks it up and pushes the notification to the client.

In this design, are there any possible flaws as everything is running localhost? My concerns are about the reliance on server components running on localhost. Is it even practical to run distributed components on localhost in production software?

Can this setup lead to unstable conditions in the runtime environment esp because the desktop application is talking to the backend server on the same machine?

4
  • ...also, please don't cross-post: stackoverflow.com/questions/75316636/… "Cross-posting is frowned upon as it leads to fragmented answers splattered all over the network..."
    – gnat
    Commented Feb 1, 2023 at 22:12
  • Sorry, I thought the sites were different altogether. I will not do that next time. Commented Feb 1, 2023 at 22:15
  • You may need consider what users the processes are running as. If you run the backend as a service you get some failure handling for free. You might also reduce the risk of user created problems by ensuring the user has as few privileges as possible.
    – JonasH
    Commented Feb 2, 2023 at 9:03

1 Answer 1

4

Running a distributed application on one machine does not make it "less stable", as long as the different components don't require too much CPU and memory resources available on the single machine. Quite the opposite, local TCP/IP connections will typically be more failsafe than connections over a complex LAN or WAN, where a lot more hardware and software components like cables, switches, routers or VPN components are working in the middle. Using network protocols on a local machine is a common way for implementing interprocess communication.

On the other hand, one has to be aware the single machine is also a single point of failure. In a multiple machine setup, there might be multiple points of failure, but it may be easier to replace a single failing component (up to the point where this automatically happens in some datacenter).

Hence you have to care for backups of the data and redundancy of hardware up to the degree where it suits your safety requirements. That statement, however, is also true for a multi-machine setup.

What I cannot tell you is if you really need a distributed architecture when your application is intended to operate on only one machine. Maybe you want the option to scale it up to multiple machines at a later point in time? That might be a justification. But in case the application is planned to run exclusively on a single machine, one should consider if there isn't a simpler setup possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.