The divide approach
If the system is well structured, maybe some parts of it can be cleanly split into its own system, maintaining the same code.
In this case, creating a new service is more an exercise of copy-pasting and wrapping it around with the minimal amount of code to allow it to be executed independently and to interoperate with other systems, in other words, to structure its API around HTTP requests to have a standard interface.
If this approach can be used, it means that the code was already quite structured, which is fantastic news.
The systems that are called to this part will also have to be adapted to make the call, not to internal code, but through HTTP calls. The good part is that this can be done in a few steps:
- Copy the code into its own microservice and deploy it.
- The old calling system is using the old embedded code.
- Migrate a call and check that the system is working fine.
- Iterate until all old calls are migrated to the new system.
- Delete the divided code from the old system.
If the code is not so cleanly structured, we will need to change it first.