Part I: Micro-service Architecture

Before we dive into micro-architecture, I would want to go back to where we initially started.

Initially, N-Tier architecture and monolithic apps were standard for any organization. Where in we had a single web artifact, that was decomposed into layers like the presentation layer, business logic layer and the data access layer.p1

Each of these layers would further decompose into layers themselves like I/O , processing. And they would again decompose into further layers. What we got out of it?  Separation of concerns and decomposition of code into functional components. Disadvantage was that the code was highly coupled and any changes would hamper other components. Again the cycle for the entire deployment would be stretched, in case of any bugs it will have to go through the cycle of development testing and deploying all over again.

Then came SOA( Service oriented Architecture) Now SOA  used SOAP. So, every request was either OK or server error that was really not the case, there could be many server level errors. The second problem was with the aggregation layer, the data was in XML format and it  started getting aggregated in the bus itself.

Now we have the micro-service architecture, micro- service architecture promised agility and surely it did deliver .  Unlike the monolithic apps there are no layers in micro service architecture, Rather it is a self-contained piece of business function with clear interfaces, and may, through its own internal components, implement a layered architecture.

In Micro Service inter communications happen over HTTP leveraging Rest, It being the communication framework, the services can be developed in any coding language that supports ReSTful service. Each service can consume other service over the communication strategy.

Communication Strategy: Protocol Aware Heterogeneous inter-operability – Service is bound to protocol and execute communication over that protocol in a way that works in a mixed or heterogeneous environment

In micro service architecture all communications between services leverage ReST over HTTP.  Companies like Netflix, Amazon build the software and then expose their services to be consumed by others using ReST, each team can consume services as they all communicate in the same way.  A micro-service handles one set of related functions with little or no cross domain operation. Micro-service operates on well defines Domains. Operations aren’t defined on data objects or business  objects, instead it is the domain as a whole. Often these services expose domain specific CRUD operations on the domain objects, but that domain can extend multiple data objects.

Keep services small

Smaller services

  • Build Fast
  • Less Test Scenarios
  • Deploy and start much quickly
  • Fix mistakes fast in smaller components of code

p2

Lets imagine a scenario here, In your team you have PHP developer, a python developer and an asp.net dev. they all have different skill-set, the beauty of micro-architecture is that each developer can build in their own native language and then expose those services for others to consume using ReST.

To consume these services the team member need not know how these services work or learn some terminology, they simply leverage ReST the same way they would do to their own service.

Therefore this architecture provides Agility. Agility comes from each team working in the framework that they are confident in.  They can deliver code quickly, once the code is delivered they expose the contract for other to consume the service and hence there is no learning curve.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s