Can a desktop application based on a monolithic architecture be converted to a microservices architecture? I can only find articles on web applications using microservices architecture. Does that mean desktop applications cannot use this architecture?
In general, technically there is nothing that can stop you from using microservice architecture for any kind of applications, however when you go this path (like any other architecture actually) check what are benefits of microservices architecture and whether it makes sense at all in your application.
In my opinion, it doesn't make sense, and here are some thoughts that illustrate why do I think so:
- Micro-service architecture will almost certainly mean many processes
So is it a good approach to keep many processes for the desktop application? Will your customers be happy to use your application with many processes?
- Micro-service architecture usually means that various parts of the products can be developed, tested, and most important, updated in production independently.
On server side it shines, however does it make sense on desktop? I personally doubt it, however you should answer to yourself
- Micro-service architecture assumes that the different parts interconnect with each other. This can be HTTP (any other socket based protocol) for synchronous communication, Messaging systems for async communication and so forth.
If you go sockets - will you expose ports for communication? If you install this desktop application on client machine that have security policies (firewalls, etc.) will it work at all?
In case of messaging you'll have to use some messaging middleware, which is almost never a good idea to install (these tools work good on server with an appropriate hardware).
- One of the big selling points of microservice architecture (as opposed to monolith) is scalability. In theory you can scale out any specific part of your application (implemented as a microservice) independently of others. In other words - you can say: "this microservice" is under high load (or whatever other reason) so I would like to start 5, 10 or 100 instances of it.
Is it applicable in your desktop application at all?
So again, think what will be the best for your customer, for your application and for you :) and chose the correct architecture.
It certainly could be, since Windows has services, Linux has daemons and so on, and you can arrange things such that different services talk to one another via an internal network or some other mechanism depending on what is appropriate. However it's another question whether or not it is appropriate/a good idea to do so. Microservices are typically likely to make a lot more sense as an architecture for a web application. There typically is a cost with microservices in the form of looser coupling between components. Strict typing within an application will ensure messages between parts of the application are correctly formed. That is harder to ensure with services that may be compiled separately from one another and communicate via a more indirect mechanism.
© 2022 - 2024 — McMap. All rights reserved.