Our project consists of a cluster of microservices (let's say 20, mainly JS & PHP) that are communicating among themselves and exchanging data (via MQ) among themselves. Also, clusters have API available to other teams. So microservices process either our requests or API requests.
A while ago our team agreed to have our cluster documented, so
- we would be able to onboard newcomers quicker
- we would have a better overview of the structure of our cluster
- other teams will be able to make sense of our project by the bird-eye view
- other teams will have access to the API documentation for better usability
We, however, had encountered a foreseeable obstacle -> it is pretty painful and time-consuming to keep all parts of documentation up to date.
So here is our document structure:
- Overview => this is a flowchart with the flow of the data across microservices. This is done manually in diagram software with idea that flow will change very infrequently and I would say that is fine.
- Microservice documentation => this is also a manually created diagram, describing the inner workings of the single microservice since the service usually contains a couple of classes. This is basically for internal purposes (see points 1 & 2). But there is the aforementioned problem becoming visible -> since diagrams are done manually, any change in codebase will break them. Yes, we tried to make the diagrams not too much detailed, so small changes won't affect the bigger picture in diagrams. But the still static, manually created diagram is very dependent on the codebase and depends on the discipline of the team to keep diagrams updated. So this is problem #1.
- Configuration => There are around 30 configuration parameters that supply microservices with settings or directions specific service should behave. This configuration is set either by us or by other teams in case of API use. So documentation needs to be clear and polished for all stakeholders. Similar to the previous point, these parameters change relatively frequently and needs to be kept up to date. There comes problem #2.
So my question would be, how would you handle such documentation?
I am pretty sure we are not the only team under the sun that uses microservices and needs to have their project covered by understandable documentation.
Problem #1 is documentation of data flow within a single microservice. Basically opening a black box
Problem #2 is documentation of configuration parameters. These are used for behaviour directives for specific microservices.
We are looking for processes or approaches (and consequently technical solutions), that would at least partially automate this documentation creation and management.
Thank you all for sharing your solutions and all your suggestions.