Services or Shared Libraries?
- by Royal
I work in an environment where we have several different web applications, where each of them have different features but still need to do similar things: authentication, read from common data sources, store common data, etc.
Is it better to build the shared functionality into a set of services, to be called by the web apps, or is it better to make a shared library, which the webapps include?
The services or libraries would need to access various databases, and it seems like keeping that access in a single place (service) is a good idea. It would also reduce the number of database connections needed. A service would also keep the logic in a single place, but then it could be argued that a shared library can do the same thing. Are there other benefits to be gained from using services over shared libraries?