Microservices Architecture Primer for Building Microservices with JHipster
Introduction
In this article, we will give you a brief overview of microservices as a primer for working with JHipster to build web applications with a Microservices backend.
We will go into detail about several general characteristics of microservices. If you want to learn more, check out the JHipster Github Repo.
General Overview
Microservices architecture as a service‑oriented architecture composed of loosely coupled elements that have bounded contexts — Adrian Cockcroft
There is no precise definition of the microservices architectural style. However, in general, at a high-level, the Microservice architectural style is an approach to application development where you create a suite of separate, independent services.
Microservices:
- Run in their own separate process.
- Are independently scalable.
- Are independently deployable.
- Have their own data store.
- Generally built around a single business capability.
- Communicate with other microservices using a lightweight protocol such as HTTP.
- Are decoupled and cohesive.
Microservices are small, autonomous services that work together — Sam Newman
Microservice Characteristics Overview — LinkedIn Learning
The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API — Martin Fowler
Componentization via Services
Component: A component is a unit of software that is independently replaceable and upgradeable.
In a Microservice architecture, each service acts as a component.
Services Organized around Products NOT Projects
Project: A piece of software is delivered then handed over.
vs.
Product: The development team takes ownership of software from design to deployment.
It’s important to leverage Cross-functional teams such that a team owning a service has everyone they need to implement a new feature. They shouldn’t have to reach out to a seperate design, UI or database team to build out new features.
Smart endpoints and dumb pipes
Be of the web, not behind the web — Ian Robinson
Move away from heavyweight message brokers like an Enterprise Service Bus and towards HTTP and lightweight messaging queues for inter-service communication.
Move towards coarser-grained communication between services to get more work done per message and decrease the total number of messages.
Additional Microservice Characteristics
Decentralized Data Management
Bounded Context: Method of dealing with large models by dividing them into different contexts with explicitly defined interrelationships.
Each service boundary should correspond with a bounded context.
Polyglot Persistence: Each service manages its own database which can be entirely different database systems. e.g. RDMS, noSQL or graph
Each service should have it’s own database. Each team should be free to select the datastore that best serves their needs.
Infrastructure Automation
Self-service: Allow developers to provision their own new servers or VMs.
You definitely need to move towards Continuous Integration/Continuous Delivery and automate deployment to each new environment. It’s also important to run lots of automated tests and static analysis.
You also want to be able to scale your infrastructure automatically.
Design for Failure
Applications need to be designed so that they can tolerate the failure of services. Clients must respond to failure as gracefully as possible.
It’s important to be able to detect the failures quickly and, if possible, automatically restore service. e.g. Self-healing services
Sophisticated monitoring and logging is also needed.
Want to learn more?
Interested in learning more about this topic? Then check out this course on LinkedIn Learning that will cover the following:
- Comprehensive overview of Microservice Architecture.
- Overview of JHipster.
- Walkthrough of how to create a Microservice application leveraging Java8, Spring, Netflix OSS and Angular using the JHipster Yeoman framework.
- Walkthrough of how to deploy this application to AWS, Azure and Cloud Foundry.
Check it out here:
Originally published on LinkedIn Pulse(https://www.linkedin.com/pulse/microservices-architecture-primer-doing-jhipster-chris-anatalio/)
JHipster is sponsored by Ippon Technologies(https://www.ippon.tech/).