In this short post, we will get an introduction to microservices. We get an answer to a popular question “what are microservices?”
1. What are Microservices?
Microservices is a software development technique that structures an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. Microservice is an architectural style in which a complex system is decomposed or broken down into smaller services based on the functionality that work together to form larger business services.
[pullquote align=”normal” cite=”@Chris Richardson, Microservices.io”]“Microservices – also known as the microservice architecture – is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack.”[/pullquote]
Microservice architecture comprises small and autonomous services. Each service self-contained and independently deployable, which means breaking a large application into loosely coupled modules. Microservices are not inverted, rather they are evaluated from the previous architecture styles such as MONOLITHIC Architecture.
2. Why Microservices?
Here are some advantages of designing our application based on microservices architecture.
- Technology Heterogeneity – Different Services can be implemented in several technologies (i.e., Java, Node.js, Ruby, .Net, etc.,) and communicate with each.
- Fault isolation – Isolation of a fault much easier in Microservice compares to monolithic architecture style applications. For example memory leakage, replication of DB issues, etc.,
- Scaling – Utilization of an application rapidly increasing day-by-day as also which cause the performance getting down and it leads to the scaling of an application are necessary. It can be horizontal scaling or vertical scaling.
- Ease of Deployment – Deploying the monolithic application takes more time sometimes it takes hours to deploy and ready to use if the load is high however as Microservice is complex applications are composed of small, highly decoupled and focus on doing a small task, facilitating a modular approach to system-building.
- Optimizing for replaceability – Services can run with its own architecture or technology aligned to a single business capability, so they perform only one function. To change or replacing or deprecate a service can be optimized and won’t take much time to develop service within or various technology and doesn’t affect other’s services.
- Cloud support – Cloud changes the way IT supports the business. A well-architected cloud platform enables services to be picked up from across a hybrid private/public cloud ecosystem. With a microservices-based approach to facilitating an organization’s process needs, it becomes far easier to try something out; to see if a change of just one part of a process—a single task—can have a major beneficial impact on the overall outcome of the process.
3. Challenges in Microservices
Microservices are more complex than legacy system. The environment becomes more complicated because services have to manage, secure, monitor and support.
- Organization culture – To harness the speed of delivery of microservices, the organization should adopt Agile development processes, continuous integration, automated QA checks, automated delivery pipelines.
- Increasing of Microservices which required multiple deployments and also more opportunities to fail, and the systems will fail.
- Multiple deployments mean required a resource i.e., hardware and engineering resources are scarce and expensive. How does the organization prioritize when there are hundreds or thousands of microservices?
- Migration–Migrating the Monolithic to Microservices architecture requires you to determine the right boundaries for microservices and this process is complex.
- With a microservices approach, this raises several questions:
- Should you allow code to be migrated to different services?
- How to monitor overall system health and identify potential hotspots early on?
- Handle versioning?
- How to analyze high amounts of log data in a distributed application?
- How do you monitor the performance of microservices?
4. Microservices Architecture
Here is a high-level overview of microservices.
5. Microservices Communication
Communication between microservices can be designed either in SYNCHRONOUS or ASYNCHRONOUS styles. In general, microservices communicate with each other using widely adopted lightweight protocols, such as HTTP and REST, or messaging protocols, such as JMS or AMQP. In specific cases, one might choose more optimized communication protocols, such as Thrift, ZeroMQ, Protocol Buffers, or Avro.
It is not possible to develop a system with just one approach. A combination of both approaches is required based on the use cases. In principle, the asynchronous approach is great for microservices. However, attempting to model everything as asynchronous leads to complex system designs.
6. Microservices Infrastructure
The one microservice can be deployed in one or multiple Virtual Machines (VMs) or physical Machines by replicating the deployment for scalability and availability. Multiple Microservices can be deployed int one VM if the service is simple and the traffic volume is less.
In case of cloud infrastructure, the developers need not worry about where the services are running. Services will be deployed in a compute cloud, the infrastructure self-manages deployments. Cloud infrastructure is the best option if origination contains hundreds of microservices.
In this post, we got a basic understanding of microservices. We get understanding of what are microservices and core principles for building microservices. We covered the architecture as well the challenges while working with these services.
2 thoughts on “What are Microservices”
Nice and useful information
Comments are closed.