microservicearchitecture in detail over monolith

17
Microservices Architecture By Durga Lovababu

Upload: plovababu

Post on 28-Jul-2015

42 views

Category:

Software


0 download

TRANSCRIPT

Page 1: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

By Durga Lovababu

Page 2: MicroserviceArchitecture in detail over Monolith

Agenda / Topics

• Monolithic Architecture

• Microservices Architecture

• Scalability

• When Microservices

• Microservices Prerequisites

• Demo Application

• Q?

Page 3: MicroserviceArchitecture in detail over Monolith

Monolithic Architecture

• Monolithic application describes a single tiered software application in which the user interface and data access code are combined for every feature/business requirement into a single war/ear/dll.

• There are logical components corresponding to different functional areas of the application.

• Single war/EAR/dll/exes.

• Simple to develop, deploy and manage.

Page 4: MicroserviceArchitecture in detail over Monolith

Monolithic Architecture.

• Typical Architecture Diagram.

Page 5: MicroserviceArchitecture in detail over Monolith

Monolithic Architecture End

However once the application becomes large and the team grows in size, this approach has number of drawbacks.

Large and complex code base can be difficult to understand and modify. As a result development slow down.

Overloaded IDE, As a result slower the IDE and less productivity.Overloaded Webcontainer - the larger applications slow down the server startup.Continuous deployment is difficult – in order to change in one component forces to

redeploy the entire application.Hard to Scale.Require long term commitments to technology stack upgrade.

Page 6: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

• Microservice is an Architecture style as a specialization of SOA.

• Approach to developing a single application as a suite of small services, each running its own process and communicating with light weight mechanism, often an HTTP resource APIs.

• Each micro service is small and focused on specific feature/business requirement.

• Independent scalable.

Page 7: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

• Typical Architecture diagram.

Page 8: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

Microservices can be developed independently by small team of developers.Microservices are loosely coupled, means services are independent in terms of

development and deployment.Each microservice can be developed in different programming language.The productivity of new team member will be quick enough.Should be container less deployment.Sharing the same data base instance can be avoided, and NoSQL.Microservices are easy to scale independently on demand.No long term commitments required to upgrade tech stack.Microservices are status aware.

In app metrics. Ping and health checks.

Page 9: MicroserviceArchitecture in detail over Monolith

What is Scalability?

• Is the ability of a computer application or product (hardware or software) to continue to function well when it is changed in size or volume in order to meet a user need.

• Capable of being easily expanded or upgraded on demand to handle increasing loads without changing design.

• A service is said to be scalable if when we increase the resources in a system, it results in increased performance in a manner proportional to resources added.

• Scalability can be achieved in two ways.• Vertical Scalability.• Horizontal Scalability.

Page 10: MicroserviceArchitecture in detail over Monolith

Scalability Continue

• Vertical Scalability. • Horizontal Scalability.

Page 11: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

Frameworks to develop Microservices.Dropwizard (written in Java)Spring Boot (“ in Java)Vert.x (“ in Java, JS, Groovy, Python, Ruby, Scala and Clojura)Grails (“ in Groovy)Ratpack (“ in Java)Play (“ in Scala and Java)Django (“ in Python)WCF (“ in .NET)

There is a option to design container less/independent deployable services using known framework spring 3+ and embedded jetty.

Page 12: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

Disadvantages.Developers must deal with additional complexity of creating a

distributed system. IDE do not support to develop distributed systems.Testing is more difficult.Developers must implement the inter service communication

mechanism.Deployment and operational complexity of deploying and managing

system comprised of many different services.Finally Distributed system are complicated to manage.

Page 13: MicroserviceArchitecture in detail over Monolith

Microservices Architecture

• Success Stories.

Page 14: MicroserviceArchitecture in detail over Monolith

When Microservices ?

Microservices approach is all about handling a complex systems.Principle: Device and conquer. Break down the complex problems into

smaller parts that can be solved independently.When you use microservices you have to work on automated

deployment, monitoring, dealing with failures and other factors that a distributed system introduces.

Don’t even consider microservices unless you have a system that’s too complex to manage as a monolithic.

Monolith first! Do pay attention to good modularity within the monolith, but don't try to decompose it into services from Greenfield systems.

Page 15: MicroserviceArchitecture in detail over Monolith

Microservices Prerequisites?

Rapid Provisioning – achieve through cloud.Basic Monitoring – metrics and health checks.Rapid Application Deployment – achieve through CD.

Page 16: MicroserviceArchitecture in detail over Monolith

Demo Application.

• Tech Stack.• Spring Boot• Spring boot embedded tomcat.• Hibernate ORM.• H2 inMemory data store.• Jsondoc user interactive documentation.• Feign and OKHTTP for client implementation.

• Interested one can clone it from here.

https://github.com/lovababu/SpringBootExample.git

Page 17: MicroserviceArchitecture in detail over Monolith

Q?