If you choose the uniform microservices approach, it is very useful to have a shared library (or several libraries) that all services use and implement many cross-cutting concerns, such as the following:
- Configuration
- Secret management
- Service discovery
- API wrapping
- Logging
- Distributed tracing
This library may implement whole workflows, such as authentication and authorization, that interact with other microservices or third-party dependencies and do the heavy lifting for each microservice. This way, the microservice is only responsible for using these libraries properly and implements its own functionality.
This approach can work even if you choose the polyglot path and support multiple languages. You can implement this library for all the supported languages and the services themselves can be implemented in different languages.
However, there...