I've been always interested in software architecture which enables continuous delivery and deployment of large, complex applications.
The age of monolithic applications has ceased. Modern software development organizations work in autonomous teams, to deliver and run multiple independent / decoupled applications in parallel. These may be developed using different coding approaches or programming languages and Technology stacks. MicroServices certainly are not a panacea, but they’re a scalable solution if you have the right problem.
One of the strongest advantages of developing MicroServices is the time required to implement the first working prototype. Time is always crucial for commercial software development, that is why both sides of this process - developers and managers - highly appreciate it. In the Technology industry speed of development and delivery of new applications and components is a differentiating factor between you and your competitors. For the last 5 years, I've been working on financial software development where milliseconds matter. That is why I am used to double-checking everything that is supposed to go into production.
When I joined the E&V Technology team I started my new journey into the world of microservices and distributed architectures.
If the amount of microservices is increasing, developers need something which will allow them to focus primarily on the domain and business logic instead of inventing the same code again and again.
We have developed a so-called "quick start" for every new Java-based backend service.
The solution is based on the Maven Archetype workflow. In just a few simple steps it will generate a cloud-ready application with many useful features described below.
The start-up set for each microservices consists of:
- SpringBoot support
- JPA entities and repositories
- basic CRUD services
- ready for use JAX-RS endpoints which are tightly connected with repositories (or SpringMVC)
- self-describing REST endpoint with Swagger
- powerful data revisions based on Hibernate Envers
- Protobuf support
- Docker support
- Jenkins CI/CD support
- Kubernetes deployment support
The following example command does the whole trick:
mvn archetype:generate \
-DserviceName="Some Cool Service" \
and the output will be ready Gradle project which you can run immediately on the local machine or deploy the application directly to Kubernetes cluster from command line.
Let's see what hides behind the scene. Our Java MicroService archetype has 10 important features. Actually, they form a very good start for new solid MicroService among others in our ecosystem.
1. SpringBoot stack
This popular framework in Spring ecosystem is a backbone of our application. SpringBoot allows creating a production-ready application from scratch. It also has a brilliant support of multilayer architecture which is easy to test and support - an indispensable feature during the whole lifecycle of a MicroService.
2. Basic Hibernate DAO layer
For all provided entities JPA classes are generated: