Traditionally, applications are developed in a monolithic style, in a single piece. It is, however, much better to build and maintain smaller pieces which can work together in perfect synchronization. That’s the idea behind microservices – development of components separately to form a single application. It is best suited for complex applications – enterprise applications or SaaS.
When the components are broken down, they can be developed simultaneously. Moreover, resolving bugs is easy as the applications offer a higher resilience. Even if a component stops functioning, it is easy to whip up a new one and enhance the scaling.
In microservices, the application is usually distributed in a network. Individual components get deployed quite ofter. So, the deployed applications are destructible. This also means that, when a component gets deployed, the services need to know the location of other services they are connecting with when. The configuration happens automatically whenever a new service instance is created. And this process is termed as service discovery.