SlideShare a Scribd company logo
Introduction to
Microservices
By Mahmoud Zidan
Software life cycle
2 16 May 2019
Gathering requirements.
The goal of analysis is to determine where the problem is, in an attempt to fix the system.
Plan sprint to meet requirements in given time. Operations are described in detail including
business rules, process diagrams, etc. The output of this stage will describe the new
system as a collection of modules or subsystems.
The real code is written here.
All the pieces are brought together into a special testing environment, then checked for
errors, bugs, and interoperability.
Putting a release into production
Doing health checks
Checking time for requests and responses …
Plan & design
Development
Testing
Analysis
Release
Monitor
What is a Microservice?
• “The microservice architectural style is an approach to develop single application as a suite of small services,
each running in its own process & communication with light weight mechanism.” . James Lewis & Martin
Fowler.
• “Microservices are SMALL & AUTONOMUS services that work together”. Book - Building Microservices, Sam
Neuman.
• There is no specific technology used to build MS.
• Some Principles and architectural patterns are used to build MS.
3 16 May 2019
Microservice overview
Micro
• Big/small, who decide ?
• Is it the number of lines in code ?
• Is it the number of developers in
team?
• There is no universal measure . One
microservice should do ONE THING
& do it well.
• It is micro because of the scope of
functionality not line of code.
• Subdomains should be identified to
know the scope of functionality.
• Bounded context
• Should be built around business
capability

Recommended for you

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices

The document provides an overview of microservices architecture including: - Definitions and characteristics of microservices such as componentization via services, decentralized governance, and infrastructure automation. - Common drivers for adopting microservices like agility, safety, and scalability. - Guidelines for decomposing monolithic applications into microservices based on business capabilities and domain-driven design. - Discussion of differences between microservices and service-oriented architecture (SOA). - Ecosystem of tools involved in microservices including development frameworks, APIs, databases, containers, and service meshes. - Common design patterns and anti-patterns when developing microservices.

microservicessyntoucharchitecture
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices

The introduction covers the following 1. What are Microservices and why should be use this paradigm? 2. 12 factor apps and how Microservices make it easier to create them 3. Characteristics of Microservices Note: Please download the slides to view animations.

javaspring bootsoa
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps

This document provides an overview of microservices architecture, including concepts, characteristics, infrastructure patterns, and software design patterns relevant to microservices. It discusses when microservices should be used versus monolithic architectures, considerations for sizing microservices, and examples of pioneers in microservices implementation like Netflix and Spotify. The document also covers domain-driven design concepts like bounded context that are useful for decomposing monolithic applications into microservices.

microservicesddddomain driven design
Microservice overview
Service
• It is an independently deployed component for bounded context.
• Interoperability.
• Uses message based communication.
• Independent from technologies.
• Simply it is SOA
Monolithic application
Simply a monolithic application consists of
• Model
• Single database
• User interface
• APIs can be exposed for third parties
• You can have more than one instance running behind load balancer
Monolithic application
Front end
user
Address
Order
Invoice Product Category
Supplier
Monolithic application
Pros
• Simple to build
• Simple to test
• Simple to deploy
• Simple to scale
• Multiple instances
• Simple to develop
• Limited to one language.
Cons
• The bigger the app, the bigger the team.
• New team members productivity is low.
• Code harder to understand & modify.
• Not updated with new technologies.
• Startup of app will take long time.
• Scale for bad reasons
• Need more CPU for calculating invoices, you will
scale the whole app.

Recommended for you

Azure API Management
Azure API ManagementAzure API Management
Azure API Management

Presentation delivered to the Brisbane Global Integration Bootcamp 2018. Most slide sourced from Microsoft.

azurewindows azuremicrosoft azure
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices

Microservices architectures are changing the way that organizations build their applications and infrastructure. Companies can now achieve new levels of scale and efficiency by disaggregating their large, monolithic applications into small, independent “micro services”, each of which perform different functions. In this session, we’ll introduce the concept of microservices, help you evaluate whether your organization is ready for microservices, and discuss methods for implementing these architectures.

amazon-web-servicesmicroservicesaws
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless

This document discusses serverless computing and AWS Lambda. It provides an overview of virtual machines, containers, and serverless/functions as a service. It describes how AWS Lambda works, including how to author functions using various programming languages. It also discusses how to integrate Lambda with other AWS services like API Gateway, Step Functions, S3, DynamoDB and more. It introduces the AWS Serverless Application Repository and AWS SAM for defining serverless applications.

rise2018developer workshopserverless
Monolithic application
• Taking monolithic app and dividing it to smaller services will lead to:
• Concentrating on something smaller
• Software life cycle is still the same, but moves faster.
• Smaller teams
• Small services will live side by side.
Moving to Microservice
• Microservice should be “Domain Driven Design”.
• Taking the monolith application and moving to domain driven design
• Domain:
• E-commerce
• Sub-domains:
• User: Auth, profile, address,…
• Order: invoices, discount,…
• Product: Prodcuts, suppliers,…
• Dependencies:
• Sub domians should be totally independent. If you find any dependencies duplicating entities is
required.
Moving to Microservice
Front end
user
Address
Order
Invoice
Product
Category
Supplier
user
Product
Moving to Microservice
• Organization
• Teams will be divided by subdomain not domain
• Right sized team for each subdomain
• Each team will be solely responsible for their final product
• Each team should be independent, but the communication between them should be
handled by management
• Each team should have their own repo.

Recommended for you

An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices

This document provides an introduction to microservices architecture. It discusses why companies adopt the microservices style, how to design microservices, common patterns, and examples from Netflix. The key points are: 1) Microservices architecture breaks applications into small, independent services that communicate over well-defined interfaces. This improves modularity, scalability, and allows independent deployments. 2) When designing microservices, services should be organized around business capabilities, have decentralized governance and data, and be designed to fail independently through patterns like circuit breakers. 3) Netflix is a leader in microservices and has open sourced many tools like Hystrix for latency handling and Eureka for service discovery that

architecturemicroservicesnetflix
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture

SCS 4120 - Software Engineering IV BACHELOR OF SCIENCE HONOURS IN COMPUTER SCIENCE BACHELOR OF SCIENCE HONOURS IN SOFTWARE ENGINEERING All in One Place Lecture Notes Distribution Among Friends Only All copyrights belong to their respective owners Viraj Brian Wijesuriya vbw@ucsc.cmb.ac.lk

softwareteachingsoftware development
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservices

1) Event-driven microservices involve microservices communicating primarily through events published to an event backbone. This loosely couples microservices and allows for eventual data consistency. 2) Apache Kafka is an open-source streaming platform that can be used to build an event backbone, allowing microservices to reliably publish and subscribe to events. It supports streaming, storage, and processing of event data. 3) Common patterns for event-driven microservices include database per service for independent data ownership, sagas for coordinated multi-step processes, event sourcing to capture all state changes, and CQRS to separate reads from writes.

apache kafkamicroservicesevent-driven
Moving to Microservice
• Data store
• Each MS should have its own database
• Example:
• Product: relational database
• Order: NoSQL
• User: LDAP
• Problem ?!
• If user changes his address it should be replicated in the entity found in order sub-domain.
• In MS world there is no distributed transaction [ in same transaction you update more than 1 table in
different databases] due to performance issures
• Therefore, data is not immediately consistent.
Moving to Microservice
• Data store
• Solution for data sync is using change data capture or event sourcing pattern.
• Both are ways of modeling data, especially at scale, using a combination of a mutable database.
• Service publishes event when data changes and other services will consume the event and
update data.
• Kafka can be used for keeping data in sync
• UI
• Composition pattern can be used to be consistent
• Client side
• Server side
Moving to Microservice
• Services
• Communication
• Remote Procedure Invocation/call (RPC):
User Order Product
• Request / reply principle (purchase request product price)
• Can be sync/async
• REST or SOAP can be used
Moving to Microservice
• Services
• Communication
• Messaging:
• Message or events
• On broker or channel
• MS can publish an event & the MS who is in need can subscribe to broker & receive the message at a later
time
• Kafka can be used also.
User ProductOrder
Broker

Recommended for you

Why Microservices
Why MicroservicesWhy Microservices
Why Microservices

Presentation given during Start Up Day Hong Kong on September 15, 2017 within the Architecture track

hk_startup_daystartupmicroservices
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles

- Microservices advocate creating a system from small, isolated services that each own their data and are independently scalable and resilient. They are inspired by biological cells that are small, single-purpose, and work together through messaging. - The system is divided using a divide and conquer approach, decomposing it into discrete subsystems that communicate over well-defined protocols. Each microservice focuses on a single business capability and owns its own data and behavior. - Microservices communicate asynchronously through APIs and events to maintain independence and isolation, which enables continuous delivery, failure resilience, and independent scaling of each service.

microservicearchitecture
An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...

Microservices are an architectural approach to decompose complex applications into smaller, independent services. AWS customers benefit from increased agility, simplified scalability, resiliency, and faster deployments by migrating from monoliths to microservices based architecture. In this session, we will provide an overview of the benefits and challenges of microservices, and share best practices for architecting and deploying microservices on AWS. We will dive into different approaches you can take to run microservices applications at scale and explore how services like Amazon ECS, AWS Lambda, and AWS X-Ray make it simpler to design and maintain these applications. Learning Objectives: 1. Understand the fundamentals of the microservices architectural approach 2. Learn best practices for designing microservices on AWS 3. Learn the basics of Amazon EC2 Container Service, AWS Lambda, and AWS X-Ray

dockercloud computingdevops
Moving to Microservice
• Services
• Communication
• Using any of the two methods you need protocol format exchange
• Text (JSON, XML,…) readable and easy to implement
• Binary (gRPC) more compact
• MSs need contracts to know the APIs of other MSs.
• Example: WSDLs & Swagger files.
Moving to Microservice
• Distributed services
• MSs are deployed where there network locations are changed dynamically.
QUESTION?
How can MSs communicate with each other when there locations are changed
dynamically ?
ANSWER
Service registery
Moving to Microservice
• Distributed services
• Service registry
• It is a phonebook of services
• MSs should register them selves on startup and at shutdown
• You can lookup by their logical names
• Product: 127.0.0.1:8080
• Eureca can be used for this
Moving to Microservice
• Distributed services
• Best way for FE to call MS is putting an API gateway
Front end
user Order Product
API Gateway

Recommended for you

Microservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaMicroservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | Edureka

YouTube Link: https://youtu.be/xuH81XGWeGQ ** Microservices Architecture Training: https://www.edureka.co/microservices-... ** This Edureka's video on Microservices Design Patterns talks about the top design patterns you can use to build applications. In this video, you will learn the following: 1:29 Why do we need Design Patterns? 3:41 What are Design Patterns? 4:28 What are Microservices? 6:00 Principles behind Microservices 10:24 Microservices Design Patterns Follow us to never miss an update in the future. YouTube: https://www.youtube.com/user/edurekaIN Instagram: https://www.instagram.com/edureka_learning/ Facebook: https://www.facebook.com/edurekaIN/ Twitter: https://twitter.com/edurekain LinkedIn: https://www.linkedin.com/company/edureka Castbox: https://castbox.fm/networks/505?country=in

microservices design patternsmicroservices architecture patternsdesign patterns for microservices
Api Gateway
Api GatewayApi Gateway
Api Gateway

API Gateways are the well suited service for microservices architecture. It provides many security and performance related features along with reliability of the system. These slides explains what is API Gateway. What is microservices architecture, its benefits and how API Gateway empower this architecture. Further more API Gateway aggregation is explained with an example.

securityapi
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...

( Microservices Architecture Training: https://www.edureka.co/microservices-... ) This Edureka's Microservices tutorial gives you detail of Microservices Architecture and how it is different from Monolithic Architecture. You will understand the concepts using a UBER case study. In this video, you will learn the following: 1. Monolithic Architecture 2. Challenges Of Monolithic Architecture 3. Microservice Architecture 4. Microservice Features 5. Compare architectures using UBER case-study

microservicesonlinetrainingmicroservicesforbeginnersmicroservicearchitecturetutorial
Moving to Microservice
• Distributed services
• Best way for FE to call MS is putting an API gateway
• Unified interface
• Can control the cross cutting functionalities (Authentication, Authorization, register, …)
• API translation
Moving to Microservice
• Security
• Use identity and access mangement for authentication and authorization.
• Once signed in Access-token can be used to move from one MS to another
• Scalability
• You can scale one MS or more.
• Scaling can be:
• Vertical:
• adding more power to existing machine (more CPU/RAM …)
• Horizontal:
• replicate more machines. i.e. several instances
• Client load balancing will choose from registry. (using round robin for example)
Product1: x.y.z:80
Product2: a.b.c:81
Moving to Microservice
• Availability
• Minutes is up and operational
• We have in this architecture some single point of failures
• Broker
• API Gateway
• Registry
• ALL POF should be scaled horizontally (multiple instances) & clustered to be in sync
Moving to Microservice
• Monitoring
• Should be centralized
• Use log aggregation (Log stash can be used)
• Should be visual in dashboard (Splunk/ Kibana can be used)
• Health check
• Service running. Cant handle requests. Should show database status, available space,…
• Record exceptions in tracker system cyntralized
• Gather statistics (DropWizard can be used)
• Limit traffic to defend DOS attachks
• A coorelation id (transaction_id) for the journey of the request (dapper can be used)

Recommended for you

Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns

This is the video capture of the meetup described at https://www.meetup.com/lifemichael/events/287981390/ This video includes the two talks the meetup included. The first one is an introductory talk for the topic. The second one covers the SAGA design pattern.

microservicesdesign patternsarchitecture
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. It allows developers to manage multiple versions and stages of APIs, monitor access by third party developers, and handle traffic spikes without operational burden. API Gateway supports features like throttling, authorization, caching of responses, and SDK generation to make APIs easy to consume.

awsaws cloudcloud computing
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices

The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. In this slide we have discussed, Monolithic application vs Microservices, applicable scenarios for adopting the architectural pattern, when we need microservices, what are the benefits, case study of an e-commerce platform by compartmentalizing the scopes into different sample microservices and Docker implementations. The full talk has been recorded here: https://youtu.be/tNlp7HS533g

devopscontainersingle responsibility principles
Moving to Microservice
• Deployment
• Can be on physical or virtual servers (still physical but can control CPU/RAM)
• MS should be packaged with its dependencies in container image & deployed as a
container
• Images can be easily moved from one environment to another. ( Docker to be used)
• Kubernetes is used to orchestrate the contianers
• Jenkins is used for continuous delivery
• There should be an external configuration for diff environments
• Putting debug mode in dev environment only
• Activating new functionality through configuration
Challenges
• Business concerns
• Integration between teams is difficult
• Many trainings need to be done as different dev. Stacks
• There is no standard in MS.
• Solution will rely on some standards (HTTP,SQL,..) but not standard stack.
• There is no single framework, but there is an integration of different technologies
• No single support
• Cost
• Small team
• Cheap start, cheap deployments on cloud
• Time
• Faster to market.
Challenges
• Technical concerns
• Design
• How to partition the system to services (invoices could’ve been services)
• How small !?
• Technical diversity
• Choose programming language
• Right database
• Distribution
• Communication over network
• How to deal with network failures (circuit breaker)
• Data store
• Database per subdomain
• Keep data in sync
• Security
• Access token renewal
Challenges
• Technical concerns
• Testing
• Less code will be tested
• Test in isolation
• Integration testing is hard
• Maintenance
• Less code to maintain
• Less code to understand
• Extensibility
• New feature, new MS

Recommended for you

The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture

This document discusses monolithic architecture and microservices architecture. It begins by defining monolithic architecture as having a single code base with multiple components/modules. It then lists advantages like being simple to develop, test, deploy and scale, as well as drawbacks like flexibility, maintenance, reliability, and scaling challenges. Microservices architecture is presented as a solution to problems with monolithic architecture. Each microservice has a specific focus and functionality. Benefits include improved testability, loose coupling, and ability to develop, deploy and scale services independently. Challenges include increased complexity of developing, testing and operating distributed systems. The document provides examples and discusses strategies for migrating a monolithic system to microservices, technologies

technologymicroservicesarchitecture
Microservice intro
Microservice introMicroservice intro
Microservice intro

This document provides an overview of microservices and monolithic architectures. It discusses how monolithic applications are self-contained and execute end-to-end tasks, while microservices are small, independent services that communicate to perform tasks. The document outlines characteristics of each approach and compares their advantages and disadvantages, such as improved scalability, deployment and innovation with microservices versus better performance with monolithic architectures. Examples of companies using microservices are also provided.

monolithicarchitecturemicroservice
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices

Presentation created for Third and Final Year students of , The Department of Information Technology, Bharati Vidyapeeth (Deemed to be University) College of Engineering, Pune. Collage has invited myself for a training program on “Recent Trends in Information Technology”. I presented on topic of "Serverless Microservices". It is Level-100 Session.

serverlessprinciples of microservicesacademic presentation
When to use MS ?
Time to market Extensibility
Replicability Scalability
Thank You

More Related Content

What's hot

Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
Lalit Kale
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
Bozhidar Bozhanov
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Roger van de Kimmenade
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
Anil Allewar
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
Araf Karsh Hamid
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
Daniel Toomey
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Amazon Web Services
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
Cisco DevNet
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
tyrantbrian
 
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservices
Andrew Schofield
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
Amazon Web Services
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
Sanjoy Kumar Roy
 
An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...
Amazon Web Services
 
Microservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaMicroservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | Edureka
Edureka!
 
Api Gateway
Api GatewayApi Gateway
Api Gateway
KhaqanAshraf
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Edureka!
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
Haim Michael
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
Amazon Web Services
 

What's hot (20)

Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservices
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
 
An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...An Overview of Designing Microservices Based Applications on AWS - March 2017...
An Overview of Designing Microservices Based Applications on AWS - March 2017...
 
Microservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | EdurekaMicroservices Design Patterns Explained | Edureka
Microservices Design Patterns Explained | Edureka
 
Api Gateway
Api GatewayApi Gateway
Api Gateway
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 

Similar to Introduction to Microservices

Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
M A Hossain Tonu
 
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture
Paria Heidari
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
ramesh_sharma
 
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
Lalit Kale
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
Abdul Basit Munda
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
Vinod Wilson
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
Srinivasan Nanduri
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptx
PINGXIONG3
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutes
Andrew Siemer
 
Microservices vs monolithics betabeers
Microservices vs monolithics   betabeersMicroservices vs monolithics   betabeers
Microservices vs monolithics betabeers
Jesús Mª Villar Vazquez
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
Amin Arab
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
David Chou
 
SOA vs Microservices vs SBA
SOA vs Microservices vs SBASOA vs Microservices vs SBA
SOA vs Microservices vs SBA
Michael Sukachev
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
Alex Thissen
 
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
AFAS Software
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
PLovababu
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
Engin Yoeyen
 
Micro services and Containers
Micro services and ContainersMicro services and Containers
Micro services and Containers
Richard Harvey
 

Similar to Introduction to Microservices (20)

Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
 
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptx
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutes
 
Microservices vs monolithics betabeers
Microservices vs monolithics   betabeersMicroservices vs monolithics   betabeers
Microservices vs monolithics betabeers
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
SOA vs Microservices vs SBA
SOA vs Microservices vs SBASOA vs Microservices vs SBA
SOA vs Microservices vs SBA
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
 
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Micro services and Containers
Micro services and ContainersMicro services and Containers
Micro services and Containers
 

Recently uploaded

NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Softwares
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
ssuser2b426d1
 
Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
sheqnetworkmarketing
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
miso_uam
 
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
Semiosis Software Private Limited
 
Cultural Shifts: Embracing DevOps for Organizational Transformation
Cultural Shifts: Embracing DevOps for Organizational TransformationCultural Shifts: Embracing DevOps for Organizational Transformation
Cultural Shifts: Embracing DevOps for Organizational Transformation
Mindfire Solution
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
Philip Schwarz
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
DNUG e.V.
 
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
bhatinidhi2001
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
Ortus Solutions, Corp
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
akshesh doshi
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
AUGNYC
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
Hironori Washizaki
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
VishrutGoyani1
 
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
avufu
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
kalichargn70th171
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
TwisterTools
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
DNUG e.V.
 

Recently uploaded (20)

NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial Company
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
 
Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
 
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
React vs Next js: Which is Better for Web Development? - Semiosis Software Pr...
 
Cultural Shifts: Embracing DevOps for Organizational Transformation
Cultural Shifts: Embracing DevOps for Organizational TransformationCultural Shifts: Embracing DevOps for Organizational Transformation
Cultural Shifts: Embracing DevOps for Organizational Transformation
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
 
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
 
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
一比一原版英国牛津大学毕业证(oxon毕业证书)如何办理
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
 

Introduction to Microservices

  • 2. Software life cycle 2 16 May 2019 Gathering requirements. The goal of analysis is to determine where the problem is, in an attempt to fix the system. Plan sprint to meet requirements in given time. Operations are described in detail including business rules, process diagrams, etc. The output of this stage will describe the new system as a collection of modules or subsystems. The real code is written here. All the pieces are brought together into a special testing environment, then checked for errors, bugs, and interoperability. Putting a release into production Doing health checks Checking time for requests and responses … Plan & design Development Testing Analysis Release Monitor
  • 3. What is a Microservice? • “The microservice architectural style is an approach to develop single application as a suite of small services, each running in its own process & communication with light weight mechanism.” . James Lewis & Martin Fowler. • “Microservices are SMALL & AUTONOMUS services that work together”. Book - Building Microservices, Sam Neuman. • There is no specific technology used to build MS. • Some Principles and architectural patterns are used to build MS. 3 16 May 2019
  • 4. Microservice overview Micro • Big/small, who decide ? • Is it the number of lines in code ? • Is it the number of developers in team? • There is no universal measure . One microservice should do ONE THING & do it well. • It is micro because of the scope of functionality not line of code. • Subdomains should be identified to know the scope of functionality. • Bounded context • Should be built around business capability
  • 5. Microservice overview Service • It is an independently deployed component for bounded context. • Interoperability. • Uses message based communication. • Independent from technologies. • Simply it is SOA
  • 6. Monolithic application Simply a monolithic application consists of • Model • Single database • User interface • APIs can be exposed for third parties • You can have more than one instance running behind load balancer
  • 8. Monolithic application Pros • Simple to build • Simple to test • Simple to deploy • Simple to scale • Multiple instances • Simple to develop • Limited to one language. Cons • The bigger the app, the bigger the team. • New team members productivity is low. • Code harder to understand & modify. • Not updated with new technologies. • Startup of app will take long time. • Scale for bad reasons • Need more CPU for calculating invoices, you will scale the whole app.
  • 9. Monolithic application • Taking monolithic app and dividing it to smaller services will lead to: • Concentrating on something smaller • Software life cycle is still the same, but moves faster. • Smaller teams • Small services will live side by side.
  • 10. Moving to Microservice • Microservice should be “Domain Driven Design”. • Taking the monolith application and moving to domain driven design • Domain: • E-commerce • Sub-domains: • User: Auth, profile, address,… • Order: invoices, discount,… • Product: Prodcuts, suppliers,… • Dependencies: • Sub domians should be totally independent. If you find any dependencies duplicating entities is required.
  • 11. Moving to Microservice Front end user Address Order Invoice Product Category Supplier user Product
  • 12. Moving to Microservice • Organization • Teams will be divided by subdomain not domain • Right sized team for each subdomain • Each team will be solely responsible for their final product • Each team should be independent, but the communication between them should be handled by management • Each team should have their own repo.
  • 13. Moving to Microservice • Data store • Each MS should have its own database • Example: • Product: relational database • Order: NoSQL • User: LDAP • Problem ?! • If user changes his address it should be replicated in the entity found in order sub-domain. • In MS world there is no distributed transaction [ in same transaction you update more than 1 table in different databases] due to performance issures • Therefore, data is not immediately consistent.
  • 14. Moving to Microservice • Data store • Solution for data sync is using change data capture or event sourcing pattern. • Both are ways of modeling data, especially at scale, using a combination of a mutable database. • Service publishes event when data changes and other services will consume the event and update data. • Kafka can be used for keeping data in sync • UI • Composition pattern can be used to be consistent • Client side • Server side
  • 15. Moving to Microservice • Services • Communication • Remote Procedure Invocation/call (RPC): User Order Product • Request / reply principle (purchase request product price) • Can be sync/async • REST or SOAP can be used
  • 16. Moving to Microservice • Services • Communication • Messaging: • Message or events • On broker or channel • MS can publish an event & the MS who is in need can subscribe to broker & receive the message at a later time • Kafka can be used also. User ProductOrder Broker
  • 17. Moving to Microservice • Services • Communication • Using any of the two methods you need protocol format exchange • Text (JSON, XML,…) readable and easy to implement • Binary (gRPC) more compact • MSs need contracts to know the APIs of other MSs. • Example: WSDLs & Swagger files.
  • 18. Moving to Microservice • Distributed services • MSs are deployed where there network locations are changed dynamically. QUESTION? How can MSs communicate with each other when there locations are changed dynamically ? ANSWER Service registery
  • 19. Moving to Microservice • Distributed services • Service registry • It is a phonebook of services • MSs should register them selves on startup and at shutdown • You can lookup by their logical names • Product: 127.0.0.1:8080 • Eureca can be used for this
  • 20. Moving to Microservice • Distributed services • Best way for FE to call MS is putting an API gateway Front end user Order Product API Gateway
  • 21. Moving to Microservice • Distributed services • Best way for FE to call MS is putting an API gateway • Unified interface • Can control the cross cutting functionalities (Authentication, Authorization, register, …) • API translation
  • 22. Moving to Microservice • Security • Use identity and access mangement for authentication and authorization. • Once signed in Access-token can be used to move from one MS to another • Scalability • You can scale one MS or more. • Scaling can be: • Vertical: • adding more power to existing machine (more CPU/RAM …) • Horizontal: • replicate more machines. i.e. several instances • Client load balancing will choose from registry. (using round robin for example) Product1: x.y.z:80 Product2: a.b.c:81
  • 23. Moving to Microservice • Availability • Minutes is up and operational • We have in this architecture some single point of failures • Broker • API Gateway • Registry • ALL POF should be scaled horizontally (multiple instances) & clustered to be in sync
  • 24. Moving to Microservice • Monitoring • Should be centralized • Use log aggregation (Log stash can be used) • Should be visual in dashboard (Splunk/ Kibana can be used) • Health check • Service running. Cant handle requests. Should show database status, available space,… • Record exceptions in tracker system cyntralized • Gather statistics (DropWizard can be used) • Limit traffic to defend DOS attachks • A coorelation id (transaction_id) for the journey of the request (dapper can be used)
  • 25. Moving to Microservice • Deployment • Can be on physical or virtual servers (still physical but can control CPU/RAM) • MS should be packaged with its dependencies in container image & deployed as a container • Images can be easily moved from one environment to another. ( Docker to be used) • Kubernetes is used to orchestrate the contianers • Jenkins is used for continuous delivery • There should be an external configuration for diff environments • Putting debug mode in dev environment only • Activating new functionality through configuration
  • 26. Challenges • Business concerns • Integration between teams is difficult • Many trainings need to be done as different dev. Stacks • There is no standard in MS. • Solution will rely on some standards (HTTP,SQL,..) but not standard stack. • There is no single framework, but there is an integration of different technologies • No single support • Cost • Small team • Cheap start, cheap deployments on cloud • Time • Faster to market.
  • 27. Challenges • Technical concerns • Design • How to partition the system to services (invoices could’ve been services) • How small !? • Technical diversity • Choose programming language • Right database • Distribution • Communication over network • How to deal with network failures (circuit breaker) • Data store • Database per subdomain • Keep data in sync • Security • Access token renewal
  • 28. Challenges • Technical concerns • Testing • Less code will be tested • Test in isolation • Integration testing is hard • Maintenance • Less code to maintain • Less code to understand • Extensibility • New feature, new MS
  • 29. When to use MS ? Time to market Extensibility Replicability Scalability