Microservices features unveiled

The Advantages of Microservices

The advantages of microservices seem strong enough to have convinced some big enterprise players such as Amazon, Netflix, and eBay to adopt the methodology. Compared to more monolithic design structures, microservices:

  • Improve fault isolation: Larger applications can remain mostly unaffected by the failure of a single module.
  • Eliminate vendor or technology lock-in: Microservices provide the flexibility to try out a new technology stack on an individual service as needed. There won’t be as many dependency concerns and rolling back changes becomes much easier. With less code in play, there is more flexibility.
  • Ease of Understanding: With added simplicity, developers can better understand the functionality of a service.

Deployment of Microservices

Now that we understand microservices, how are they deployed?

The best way to deploy microservices-based applications is within containers, which are complete virtual system environments that provide processes with isolation and dedicated access to underlying hardware resources. One of the biggest names in container solutions right now is docker.

Virtual machines from infrastructure providers like Amazon Web Services (AWS) can also work well for microservices deployments, but relatively lightweight microservices packages may not leverage the whole virtual machine, potentially reducing their cost effectiveness.

Code deployments can also be completed using an Open Service Gateway Initiative (OSGI) bundle. In this use case, all application services will be running under one Java virtual machine, but this method comes with a management and isolation tradeoff.

The Disadvantages of Microservices

Microservices may be a hot trend, but it does not come without its drawbacks.

Here’s a list of some potential pain areas associated with microservices designs:

  • Developing distributed systems can be complex. Since everything is now an independent service, you have to carefully handle requests traveling between your modules. In one such scenario, developers may be forced to write extra code to avoid disruption. Over time, complications will arise when remote calls experience latency.
  • Multiple databases and transaction management can be painful.
  • Testing a microservices-based application can be cumbersome. In a monolithic approach, we would just need to launch our WAR on an application server and ensure its connectivity with the underlying database. With microservices, each dependent service needs to be confirmed before testing can occur.
  • Deploying microservices can be complex. They may need coordination among multiple services, which may not be as straightforward as deploying a WAR in a container.

Of course, with the right kind of automation and tools, all the above drawbacks can be addressed.

Related blog:

hIbernate interview questions