This article gives an understanding of what is a Microservice, Monolith architecture Vs Microservice architecture, Spring Boot support for Microservices.
What is a Microservice
Microservice is an architectural style where your application is composed of small independent services. Microservices architectures makes it faster to develop applications and easier to scale.
Monolithic Architecture
In monolithic architecture all the software components of an application are assembled together and tightly packaged in a single code base.
With this monolithic architecture you may argue that the benefits are-
- Development is easy- Since all the code is at one place so understanding flow is simpler and making changes is also simple. Inter-modular communication also doesn’t pose any problem.
- Deployment is easy- You need to deploy the archive for one application (JAR, WAR or EAR) on a server.
On the other hand. challenges of monolithic architecture are-
- Monolithic code base may become quite huge making it hard to understand and maintain.
- IDE may become slow because of the code base which means less productive developers.
- Merging the codebase in repository may also become time consuming because of large code base
- Deployment also takes more time and overloads the server.
- Continuous development and integration is difficult because update in one component results in the redeployment of whole application.
- Scaling of the application means making the copy of the whole application.
- A monolithic architecture binds you to the technology stack you chose at the start of development.
Microservice Architecture
Defines an architecture that structures the application as a set of loosely coupled, collaborating services.
Advantages of using Microservices
- Code base is small- Code base is not huge. Code of one service focuses on one business capability. That results in rapid development and maintenance is also easy.
- Smaller teams- Enables having smaller teams focused on their specific services.
- Loosely coupled- Enables independent development of services without being impacted by changes to other services and without affecting other services.
- Independently deployable- Enables a team to deploy their service without having to coordinate with other teams.
- Scalability- Services can be scaled independently. Any service requiring more resources can be scaled without scaling out the entire application.
Microservices with Spring Boot
Spring Boot provides a great platform for building microservices. Spring Boot, through its Spring Cloud starter provides many ready-to-run cloud patterns. Spring Cloud can help with service discovery, load-balancing, circuit-breaking, distributed tracing, and monitoring, it can also act as an API gateway.
That's all for this topic Spring Boot Microservices Introduction. If you have any doubt or any suggestions to make please drop a comment. Thanks!
>>>Return to Spring Tutorial Page
Related Topics
You may also like-
No comments:
Post a Comment