- ‘Microservices’ is an architectural style where a complex application is composed as a suite of small standalone services focused on a small task.
- Specialization (or nuance) of Service Oriented Architecture (SOA).
Services focus on a single function, are independently deployable, and use light-weight (or dumb) communication mechanisms like REST.
(In contrast, SOA has complex communication mechanisms like Message Brokers, ESBs, etc.)
- Allows developers to write services in the language of their choice because each service is a black-box to others i.e. for the same app, some services could be written in Python, while others in Java, Ruby etc.
- Criticism #1: Deployments could become complicated especially when many thousands services are involved.
- Criticism #2: Brings new problems into the equation such as connection overhead of each request and network latency, fault-tolerance, scaling, etc.
- Example: https://github.com/umermansoor/microservices. A movie theatre app using Microservices. Has 4 standalone services:
- Movies: Provides list of movies, ratings, title, etc.
- Show Times Service: Provides show times information.
- Booking Service: Provides booking information.
- Users Service: Provides various services for registered users such as suggested movies, etc.