No strict rules exist when it comes to building microservices. And because microservices are fairly small, rules are not as important as in, say, monolithic systems. If something doesn't look quite right, you can always come back later and reimplement it within a matter of days. However, when dealing with a large enterprise system with tens or even hundreds of microservices, structure and consistency become very much appreciated.
During my lengthy career, I’ve seen over and over again how systems were built, how they were maintained, how technologies became obsolete, how difficult it was to make changes once the systems reached a certain size and complexity, and how hesitant business managers became, when funding for various “fixes” was needed. In this sense, microservices are a huge improvement. If your system is based on a microservice architecture, then most of these problems no longer become of issue. Nonetheless, you can make your life even easier and save your company even more money if you build your microservices using componentized design.
This is how a microservice typically looks, when it’s structured using loosely coupled components.
Here are a few benefits you can expect to receive by componentizing your microservices:
The most popular microservice framework for Java - SprintBoot - uses loosely coupled components, running in a Spring container. If you are searching for a microservice framework that supports languages other than Java, or if you are considering cross-language implementations, then we highly recommend taking a look at the Pip.Services toolkit (http://github.com/pip-services/pip-services).
Happy microservicing!
Sergey Seroukhov,
Principal Consultant and Founder, Enterprise Innovation Consulting