Is this a bad idea?
No, but this is a big overall question to be able to provide very specific advice.
I'd like to separate this into 3 areas:
- Approach
- Design
- Technology
Working backwards, the Technology is the final and most-specific part, and totally depends on what your current environment is (platforms, skills), and (hopefully) will be reasonable self-evident to you once the other things are in progress.
The Design that you outlined above seems like a good end-state - having multiple, specific, focused APIs, each with their own responsibility. Again, the details of the design will depend on the skills of you and your organization, and the existing platforms that you have. E.g. if you are already using TIBCO (for example) and have a lot invested (licenses, platforms, tools, people) then leveraging some of their published patterns/designs/templates makes sense; but (probably) not if you don't already have TIBCO exposure.
In the abstract, the REST API services seems like a good starting point - there are a lot of tools and platforms at all levels of the system for security, deployment, monitoring, scalability, etc. If you are NGINX users, they have a lot of (platform-independent) thoughts on how to do this also NGINX blog, including some smart thinking on scalability and performance. If you are more adventurous, and have an smart, eager team, a look at Event-driven architecture - see this
Approach (or Process) is the key thing here. Ultimately, this is a refactoring, though your description of "a large refactor" does scare me a little - put that way, it sounds like you are talking about a big-bang change and calling it refactoring. Perhaps it is just language, but what's in my mind would be "an evolution of the 'one huge API' into multiple, specific, focused APIs (by refactoring the architecture)". One place to start is Martin Fowler, while this book is about refactoring software, the principles and approach are the same, just at a higher-level. Indeed, he talks about just this here
IBM talk about refactoring to microservices and make it sound easy to do in one step, but it never is (outside the lab).
You have an existing API, serving multiple internal and external clients. I will suggest that you'll want to keep this interface solid for these clients - separate your refactoring of the implementation from the additional concerns of liaising with and coordinating external systems/groups. My high-level starting approach would be:
- identify a small (3-7) number of related methods on the API
- ideally if a significant, limited-scope change is needed anyway with these methods, that is good - business value with the code change
- design/specify a new stand-alone API specifically for these methods
- at first, clone the existing model/naming/style
- code a new service just for these
- with proper automated CI/CD testing and deployment practices
- with associated monitoring
- modify the existing API to have calls to these methods re-direct to call the new service
- perhaps have a run-time switch to change between the old implementation and the new implementation
- remove the old implementation from codebase
- capture issues, assumptions and problems along the way
- the first pass will involve a lot of learning about what works and doesn't.
- then repeat the process over & over, incorporating improvements each time.
At some point in the future, when appropriate due to other business-driven needs, the API published to the back-end, front-end and/or public clients can change, but that is a whole different project.
As you can see, if the API is huge (1,000 methods => 140 releases) this is a many-months process, and having a reasonably frequent release schedule is important. And there may be no value improving code that works reliably and never changes, so a (potentially) large portion of the existing API may remain, just wrapped by a new API.
Other considerations:
- public API? Maybe a new version (significant changes) will be needed sooner than the internal APIs
- focus on the methods/services used by it
- what parts/services change the most (have the most enhancement requests approved)
- these are the bits most likely to change, and could benefit most from a better process/architecture
- what are future plans for change and where would the API be impacted
- e.g. change to user management, change to payment processors, change to fulfilment systems
- e.g. new business plans (new products/services)
- consider affected methods in the API
- Also see:
Probably the biggest 4 pieces of advice that I can give is:
- think refactoring: small changes that don't affect function
- think agile: small increments that are valuable, testable, achievable
- think continuous: have a vision for where you will (eventually) get to, then work the process continuously
- script & automate the processes from code, documentation, testing, deployment, monitoring...
- improving it every time!
- you have an application/API that works - keep it working!
- That is always the first priority (you just need to work to carve-out time/budget for maintenance)