Microservice architecture, or simply microservices, is a distinctive method of developing software systems that focuses on building single-function modules with well-defined interfaces and operations. The trend has gained popularity in recent years as enterprises look to become more agile and move towards DevOps and continuous testing. Microservices can help create scalable, testable software that can be delivered on a weekly basis.

Microservices have many benefits in terms of usage and execution. They are simpler to understand and deploy and can be reused across businesses. They help in singling out the defect and there is a minimum risk of any changes.

Just as there is no formal definition of the term microservices, there’s no standard model that is present in every system based on this architectural style. Still, you can expect most microservice systems to share a few notable characteristics like:
1. They can be broken down into multiple components
2. They are specially built to facilitate business needs
3. The routing process is fairly simple
4. Decentralized data management
5. Resistant to failure
6. Ideal for evolutionary systems

Microservices are not a silver bullet, and by implementing them you will expose communication, teamwork, and other problems that may have been previously implicit but are now forced out into the open. Like every system, microservices too have their own share of pros and cons.

Pros

Microservice architecture gives developers the freedom to independently develop and deploy services
(a)A microservice can be developed by a fairly small team
(b)Code for different services can be written in different languages (though many practitioners discourage it)
(c)Easy integration and automatic deployment (using open-source continuous integration tools such as Jenkins, Hudson, etc.)
(d)Easy to understand and modify for developers, thus can help a new team member become productive quickly
(e)The developers can make use of the latest technologies
(f)The code is organized around business capabilities
(g)Starts the web container more quickly, so the deployment is also faster

Cons
(a)Due to distributed deployment, testing can become complicated and tedious
(b)The increasing number of services can result in information barriers
(c)The architecture brings additional complexity as the developers have to mitigate fault tolerance, network latency, and deal with a variety of message formats as well as load balancing
(d)Being a distributed system, it can result in duplication of effort
(e)When the number of services increases, integration and managing whole products can become complicated
(f)In addition to several complexities of monolithic architecture, the developers have to deal with the additional complexity of a distributed system
(g)Developers have to put additional effort into implementing the mechanism of communication between the services
(h)Handling use cases that span more than one service without using distributed transactions is not only tough but also requires communication and cooperation between different teams

Whether or not microservice architecture becomes the preferred style of developers in future, it’s clearly a potent idea that offers serious benefits for designing and implementing enterprise applications. Many developers and organizations, without ever using the name or even labeling their practice as SOA, have been using an approach toward leveraging APIs that could be classified as microservices.