Until recently there was no real word to describe the kind of software that I developed over the last decade. I have worked on distributed systems that were massively scalable with millions of users and billions of transactions. I have worked on service oriented architectures that delivered user functionality at rapid pace. I discovered, learned and practiced a particular style of software architecture. But until recently could not find a simple phrase to describe it.
Now I can say I developed Microservices ! But what is Microservice ?
Wikipedia defines : Microservices is a software architectural style in which complex applications are composed of small, independent processes communicating with each other using language agnostic API. These services are small, highly decoupled and focus on doing a small task, facilitating a modular approach to system-building.
In short, for each service "Do one thing and do it well".
But I like following definition better
Microservice Architecture is a service-oriented architecture composed of loosely coupled elements that have bounded contexts.
Loosely coupled means each microservice is a unit of software that is independently replaceable and upgradeable and deployable. It is not microservice architecture If all services have to be deployed at once or they talk to the same database and requires coordinating schema changes. Micro services can be scaled independent of each other (ideally in elastic automated ways.). This allows separate development teams (perhaps geographically separated) to develop services using separate schedules, frameworks and methodologies.
Bounded context as name suggests is a partition or silo of domain model that is mostly selfcontained – Microservices and its peers interact purely through APIs and don’t share data or schema. The key is that each organizes and manages its own data. This is a critical feature of this architecture.
Organized around business capabilities
Now essence of Microservice is that each Microservice is they expose business functionality as a component. And then you can build your application as as suit of services by putting these components together.
Using Language Agnostic API
With language agnostic APIs, it enforces clear separation between interface of the Microservice and its implementation. This ensures true interoperability between various components. SOAP and REST are two approaches that have already become industry standard.
Marriage made in Heaven: Containers as Deployment Units.
Containers are the future of application delivery. It is an application packaging and delivery method that guarantees that your containers will always run the same, regardless of the environment it is running in. In short it is well contained. This is exactly the fundamental requirement of Microservices
Container is an old concept. Most familiar being the java web archive and servlet containers. Latest and the most popular incarnation being the docker containers. Linux containers allow higher density and better utilization of hardware resources.
The advantages are
- Rapid provisioning
- Scale quickly.
- Eliminates the environment inconsistencies
- Improves the velocity of development by allowing development teams to choose the software stack that is best for their service.
- Easy sharing
- Isolate problems
- Simplifies continuous integration and testing
- Web Containers https://en.wikipedia.org/wiki/Web_container
- Docker https://www.docker.com/whatisdocker
- Oracle Zones http://www.oracle.com/technetwork/server-storage/solaris/containers-169727.html
- How netflix does Microservices https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/
- Book titled : "Building Microservices" http://shop.oreilly.com/product/0636920033158.do
- Video Library http://www.infoq.com/microservices/
- "Microservices: Java the Unix Way" http://www.infoq.com/presentations/Micro-Services