4 ms·
"monolith microservice architecture" = libraries all of your foo-service json endpoints can be lib-foo apis (the original meaning!)
by cagenut 5y ago
"monolith microservice architecture" = libraries
all of your foo-service json endpoints can be lib-foo apis (the original meaning!)
- deleted 5y ago[deleted]
- mekkkkkk 5y agoI suppose that's true in a way. There would have to be some serious scaffolding for it to work though. For a web service, for example, libraries would have to be able to register route handlers and such that they handle independently. Perhaps they could all be initialized in a common way using DI or something from a base gateway application. Versioning and interop testing would have to be figured out in some clever way. Something like this would be the architecture I imagine.
- stavros 5y ago> Versioning and interop testing would have to be figured out in some clever way. But given that we already use libraries for everything, all of that stuff has already been figured out.
- mekkkkkk 5y agoIn my experience, for regular libraries, you usually want to pin version ranges and not always use the latest of every library. But when the main business logic and a whole team is dedicated to one of the "service libraries", whose responsibility is it to make sure that the version stays up to date across other service libraries? Do you leave it up to the main host app? Do you allow a multitude of service library versions? Do you skip versioning all together? In microservices you have an opaque facade in the form of an API that makes this a non-issue. Perhaps you'd want some simulacrum of this in the form of IPC between service libraries? Do you use some sort of contract based testing between service libraries? Put all integration testing in the host application? It's not obvious to me what the best approach would be.
- stavros 5y agoWell, you have an API for libraries as well, and an even stronger one because you can have type guarantees, which you can't do with JSON (you can use gRPC etc but people usually don't). With libraries it's easier than with microservices, because I can scan all the dependency files of all projects and immediately see which project relies on what library, which is much harder to do with microservices as a library author. With those two things, and the fact that you can just keep using an older library version if you need to, whereas you can't easily keep using an older microservice version if it's been upgraded, I think libraries have lots of advantages in this.
- mekkkkkk 5y agoI agree, there are probably a lot of advantages. It would be interesting to see a boilerplate structure for this workflow. Maybe it already exists in some form.
- stavros 5y agoI can't imagine it being different from other libraries, bundle your code up in the language's supported way, publish it in some internal registry, add it to your dependencies, that should be about it.