SlideShare a Scribd company logo
1 of 27
Download to read offline
Migrate to Microservices
Judiciously!
Petru Flueras
Software Architect - Visma Software
@pflueras
Codecamp Timisoara, Oct. 2017
About Me
● C# software engineer
● Software engineer and software architect at Océ Software
○ Huge (monolith) product ~ 1M+ LOC
● Software architect at Visma Software
○ Microservice (AWS)
● Timisoara Java User Group
● @pflueras
Why about Migration?
80% lifecycle of software = maintenance!
We have to evolve, modernize, adapt, … software repeatedly to context changes!
Recipes for building new software may not apply
Definition
Microservices architectural style:
… a single application as a suite of small services
… communicating with lightweight mechanisms
… built around business capabilities (SRP)
… independently deployable, upgradeable, replaceable!
… minimum centralized management of services
Decomposition + Distributed
Network calls (HTTP) + API
Again decomposition + API
CI/CD
Decentralized, dump pipes
Source: https://martinfowler.com/articles/microservices.html
Why about Microservices?
● Builds, broken builds, integration day(s)
○ Days/weeks to fix blocking point bugs
● We could not simply add new functionality (OutOfMemory)!
○ Single point of failure
● Highly coupled components (no clear interfaces/API)
○ Almost all classes are public
● Difficult to run system tests
○ Only at UI level (not at API level)
● Took ages to deliver business value
○ Continuous delivery
● Risk management
Frontend migration
Application decomposition
Database migration
Decomposition - Parnas
On the Criteria To Be Used in Decomposing Systems into Modules (1972):
"We have tried to demonstrate by these examples that it is almost always incorrect to
begin the decomposition of a system into modules on the basis of a flowchart. We
propose instead that one begins with a list of difficult design decisions or design
decisions which are likely to change. Each module is then designed to hide such a
decision from the others."
Source: https://www.cs.umd.edu/class/spring2003/cmsc838p/Design/criteria.pdf
Decomposition - UNIX
UNIX Time-Sharing System: Forward (Douglas McIlroy - 1978):
● Make each program to do one thing well. To do a new job, build afresh rather
than complicate old programs by adding new “features”.
● Expect the output of every program to become the input to another, yet
unknown, program. Don’t clutter the output with extraneous information. Avoid
stringently columnar or binary input formats. Don’t insist on interactive input.
● Design and build software, even operating system, to be tried early, ideally within
weeks. Don’t hesitate to throw away the clumsy parts and rebuild them.
Source: https://archive.org/details/bstj57-6-1899
Decomposition - Domain Driven Design
● A way to mark boundaries and relationships between different domain models
● A BOUNDED CONTEXT defines the range of applicability of each model
● CONTEXT MAP gives a global overview of project’s contexts and relationships
between them
● Think about what is shared and what is hidden!
● BOUNDED CONTEXTS are good candidates for microservices
Source: Domain-Driven Design: Tackling Complexity in the Heart of Software (Eric Evans, 2003)
Decomposition - Transactions
● First decomposition should be around transactional context and not around
structure!
● Avoid distributed transactions as much as possible (2PC)
● Local transactions, eventually consistent (CAP)
○ Compensating transaction?
Decomposition - Strangler Pattern
Decomposition - Strangler Pattern #2
UI (Web) Migration/Integration
1. Gateway Aggregator 2. Links 3. Web Components
AWS - Links Example
Database Migration -> Decentralized, Schema Split
● Each service owns its data!
● The hardest part of microservices is data (C. Posta)
● Code is easy, state is hard (E. Yanaga)
Database Migration
● ACID vs BASE
○ Atomic, Consistent, Isolated, Durable
○ Basic Availability, Soft-state, Eventual Consistency
● Extremely difficult to split databases!
○ Even if splitting schemas works, moving data from one schema to splitted schemas is HARD!
● Handle inconsistent situations at code level (CAP)!
○ No foreign keys
○ No transactions
Distributed Systems - Network fallacies
1. The network is reliable.
2. Latency is zero.
3. Bandwidth is infinite.
4. The network is secure.
5. Topology doesn't change.
6. There is one administrator.
7. Transport cost is zero.
8. The network is homogeneous.
Source: https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
Distributed Systems - Design for failure
A distributed system is one in which the failure of a computer you didn't even know
existed can render your own computer unusable - L. Lamport, May 1987
● Netflix
○ Chaos Monkey: … randomly terminates one of the services/instances
○ Simian Army: … consists of services (Monkeys) in the cloud for generating various kinds of failures
○ FIT: … a platform that simplifies creation of failure within our ecosystem with a greater degree of
precision for what we fail and who we will impact
● Google
○ DiRT (Disaster Recovery Test): … where systems are taken down with little or no notice to verify
that all the failure protection systems work
=> Monitoring
Distributed Systems - Stability Patterns
Avoid (cascading) failures:
● Timeouts
● Circuit breakers
● Bulkheads
● Retry (Exponential back-off, Idempotent!)
● Throttling
Deployment
● Build Pipelines and Continuous Delivery
○ Any commit represents a potential release
● Infrastructure automation!!!
○ Immutable infrastructure
○ Infrastructure as Code
○ Ansible, Terraform
At Visma: AWS test env. -> AWS staging env. ->AWS production env.
Team and Organization
● “Microservices” is a organizational change!
● Independent (decentralized) teams who fully own their services:
○ Requirements/Specifications
○ Source code
○ Quality
○ Deployment
○ Technology selection ?!
● Cross functional teams
Conway’s Law (1967)
Security
● Service to service Authorization and Authentication (service accounts?)
○ Allow? operations (inside) to an internal service
● Single Sign-On
○ SAML
○ OAuth2, Open ID
○ LDAP
● Client-side certificates
● API Keys
Considerable increase of surface attacks!
Logging
● Push logs outside service!
● Correlation IDs
● Log Aggregation (Logstash, Fluentd, Kibana, ...)
● Standardize log message format
AWS CloudWatch
Monitoring
● Inside services
○ Memory usage
○ CPU usage
○ SQL queries per minute
● Incoming to service
○ Request rate (# requests per second)
○ Error rate
○ Service latency
● Health checks (service itself + downstream services)
● Implement Alerts!
AWS CloudWatch, AppDynamics, OpsGenie
Monolith Microservices
Business Agility Low High
Team technical knowledge Good Higher
Complexity High (coupled dependencies!) Reasonable
Scalability Vertical Horizontal
API Poor quality, optional? Good if done right, mandatory
Frontend (UI) Complexity Medium Higher
Deployment Manual? - Entire application CD - by service
Logging In one place (good) Distributed
Monitoring Not necessary: all or nothing Distributed systems => Necessary!
End to end testing Relatively easy Complicated
DevOps Complicated Easy
Takeaway
Microservices:
Small autonomous services which work
together, modelled around a business
domain
Sometimes the necessary step!
Add a lot of complexity!

More Related Content

What's hot

Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filipJuraj Hantak
 
Cloud Computing Security
Cloud Computing SecurityCloud Computing Security
Cloud Computing SecurityAnshul Patel
 
CloudOpen 2012 OpenNebula talk
CloudOpen 2012 OpenNebula talkCloudOpen 2012 OpenNebula talk
CloudOpen 2012 OpenNebula talkOpenNebula Project
 
Microservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreMicroservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreVishwas N
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTThe Linux Foundation
 
Containerise everything - Why you should stop installing development environm...
Containerise everything - Why you should stop installing development environm...Containerise everything - Why you should stop installing development environm...
Containerise everything - Why you should stop installing development environm...Daniel Demmel
 
OpenStack Networking LBaaS
OpenStack Networking LBaaSOpenStack Networking LBaaS
OpenStack Networking LBaaSIlya Shakhat
 
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...WSO2
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshTony Pujals
 
linkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Meshlinkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service MeshDario Simonetti
 
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...Stefano Salsano
 
Kenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesKenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesDarren Bathgate
 
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!NATS
 
BigBlueButton Platform Components
BigBlueButton Platform ComponentsBigBlueButton Platform Components
BigBlueButton Platform ComponentsRIADVICE
 
[WSO2Con EU 2018] Architecting for a Container Native Environment
[WSO2Con EU 2018] Architecting for a Container Native Environment[WSO2Con EU 2018] Architecting for a Container Native Environment
[WSO2Con EU 2018] Architecting for a Container Native EnvironmentWSO2
 
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...The Linux Foundation
 
Openstack Neutron Insights
Openstack Neutron InsightsOpenstack Neutron Insights
Openstack Neutron InsightsAtul Pandey
 

What's hot (20)

Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filip
 
Microservices
MicroservicesMicroservices
Microservices
 
Cloud Computing Security
Cloud Computing SecurityCloud Computing Security
Cloud Computing Security
 
CloudOpen 2012 OpenNebula talk
CloudOpen 2012 OpenNebula talkCloudOpen 2012 OpenNebula talk
CloudOpen 2012 OpenNebula talk
 
Microservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreMicroservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many more
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XT
 
Containerise everything - Why you should stop installing development environm...
Containerise everything - Why you should stop installing development environm...Containerise everything - Why you should stop installing development environm...
Containerise everything - Why you should stop installing development environm...
 
OpenStack Networking LBaaS
OpenStack Networking LBaaSOpenStack Networking LBaaS
OpenStack Networking LBaaS
 
Samuel Bercovici - lbaaS for Havana
Samuel Bercovici - lbaaS for HavanaSamuel Bercovici - lbaaS for Havana
Samuel Bercovici - lbaaS for Havana
 
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...
Webinar: Achieving Economies of Web Scale in Your Enterprise with Containeriz...
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service Mesh
 
linkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Meshlinkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Mesh
 
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
 
Kenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesKenzan: Architecting for Microservices
Kenzan: Architecting for Microservices
 
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!
 
BigBlueButton Platform Components
BigBlueButton Platform ComponentsBigBlueButton Platform Components
BigBlueButton Platform Components
 
[WSO2Con EU 2018] Architecting for a Container Native Environment
[WSO2Con EU 2018] Architecting for a Container Native Environment[WSO2Con EU 2018] Architecting for a Container Native Environment
[WSO2Con EU 2018] Architecting for a Container Native Environment
 
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...
LCNA14: Security in the Cloud: Containers, KVM, and Xen - George Dunlap, Citr...
 
Openstack Neutron Insights
Openstack Neutron InsightsOpenstack Neutron Insights
Openstack Neutron Insights
 

Similar to Migrate to Microservices Judiciously!

Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageWebinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageMayaData Inc
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud WorkshopAmer Ather
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In SoaWSO2
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsPiyush Katariya
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesDiUS
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Ambassador Labs
 
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Lightbend
 
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architecture
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architectureCommit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architecture
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architectureJordi Puigsegur Figueras
 
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...NETWAYS
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesAlexander Penev
 
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020Tim Wagner
 
Cloud & Big Data: Lessons Learnt
Cloud & Big Data: Lessons LearntCloud & Big Data: Lessons Learnt
Cloud & Big Data: Lessons Learntphilipbalinov
 
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst IT
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst ITThings You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst IT
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst ITOpenStack
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthNicolas Brousse
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro servicesSpyros Lambrinidis
 

Similar to Migrate to Microservices Judiciously! (20)

Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageWebinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud Workshop
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
 
Cluster computing
Cluster computingCluster computing
Cluster computing
 
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architecture
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architectureCommit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architecture
Commit Conf 2018 - Hotelbeds' journey to a microservice cloud-based architecture
 
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...
stackconf 2023 | Infrastructure-From-Code and the end of Microservices by Ala...
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
 
Cloud & Big Data: Lessons Learnt
Cloud & Big Data: Lessons LearntCloud & Big Data: Lessons Learnt
Cloud & Big Data: Lessons Learnt
 
Microservices
MicroservicesMicroservices
Microservices
 
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst IT
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst ITThings You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst IT
Things You MUST Know Before Deploying OpenStack: Bruno Lago, Catalyst IT
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
Ansible for networks
Ansible for networksAnsible for networks
Ansible for networks
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
 

Recently uploaded

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Migrate to Microservices Judiciously!

  • 1. Migrate to Microservices Judiciously! Petru Flueras Software Architect - Visma Software @pflueras Codecamp Timisoara, Oct. 2017
  • 2.
  • 3. About Me ● C# software engineer ● Software engineer and software architect at Océ Software ○ Huge (monolith) product ~ 1M+ LOC ● Software architect at Visma Software ○ Microservice (AWS) ● Timisoara Java User Group ● @pflueras
  • 4. Why about Migration? 80% lifecycle of software = maintenance! We have to evolve, modernize, adapt, … software repeatedly to context changes! Recipes for building new software may not apply
  • 5. Definition Microservices architectural style: … a single application as a suite of small services … communicating with lightweight mechanisms … built around business capabilities (SRP) … independently deployable, upgradeable, replaceable! … minimum centralized management of services Decomposition + Distributed Network calls (HTTP) + API Again decomposition + API CI/CD Decentralized, dump pipes Source: https://martinfowler.com/articles/microservices.html
  • 6. Why about Microservices? ● Builds, broken builds, integration day(s) ○ Days/weeks to fix blocking point bugs ● We could not simply add new functionality (OutOfMemory)! ○ Single point of failure ● Highly coupled components (no clear interfaces/API) ○ Almost all classes are public ● Difficult to run system tests ○ Only at UI level (not at API level) ● Took ages to deliver business value ○ Continuous delivery ● Risk management
  • 8. Decomposition - Parnas On the Criteria To Be Used in Decomposing Systems into Modules (1972): "We have tried to demonstrate by these examples that it is almost always incorrect to begin the decomposition of a system into modules on the basis of a flowchart. We propose instead that one begins with a list of difficult design decisions or design decisions which are likely to change. Each module is then designed to hide such a decision from the others." Source: https://www.cs.umd.edu/class/spring2003/cmsc838p/Design/criteria.pdf
  • 9. Decomposition - UNIX UNIX Time-Sharing System: Forward (Douglas McIlroy - 1978): ● Make each program to do one thing well. To do a new job, build afresh rather than complicate old programs by adding new “features”. ● Expect the output of every program to become the input to another, yet unknown, program. Don’t clutter the output with extraneous information. Avoid stringently columnar or binary input formats. Don’t insist on interactive input. ● Design and build software, even operating system, to be tried early, ideally within weeks. Don’t hesitate to throw away the clumsy parts and rebuild them. Source: https://archive.org/details/bstj57-6-1899
  • 10. Decomposition - Domain Driven Design ● A way to mark boundaries and relationships between different domain models ● A BOUNDED CONTEXT defines the range of applicability of each model ● CONTEXT MAP gives a global overview of project’s contexts and relationships between them ● Think about what is shared and what is hidden! ● BOUNDED CONTEXTS are good candidates for microservices Source: Domain-Driven Design: Tackling Complexity in the Heart of Software (Eric Evans, 2003)
  • 11. Decomposition - Transactions ● First decomposition should be around transactional context and not around structure! ● Avoid distributed transactions as much as possible (2PC) ● Local transactions, eventually consistent (CAP) ○ Compensating transaction?
  • 14. UI (Web) Migration/Integration 1. Gateway Aggregator 2. Links 3. Web Components
  • 15. AWS - Links Example
  • 16. Database Migration -> Decentralized, Schema Split ● Each service owns its data! ● The hardest part of microservices is data (C. Posta) ● Code is easy, state is hard (E. Yanaga)
  • 17. Database Migration ● ACID vs BASE ○ Atomic, Consistent, Isolated, Durable ○ Basic Availability, Soft-state, Eventual Consistency ● Extremely difficult to split databases! ○ Even if splitting schemas works, moving data from one schema to splitted schemas is HARD! ● Handle inconsistent situations at code level (CAP)! ○ No foreign keys ○ No transactions
  • 18. Distributed Systems - Network fallacies 1. The network is reliable. 2. Latency is zero. 3. Bandwidth is infinite. 4. The network is secure. 5. Topology doesn't change. 6. There is one administrator. 7. Transport cost is zero. 8. The network is homogeneous. Source: https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
  • 19. Distributed Systems - Design for failure A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable - L. Lamport, May 1987 ● Netflix ○ Chaos Monkey: … randomly terminates one of the services/instances ○ Simian Army: … consists of services (Monkeys) in the cloud for generating various kinds of failures ○ FIT: … a platform that simplifies creation of failure within our ecosystem with a greater degree of precision for what we fail and who we will impact ● Google ○ DiRT (Disaster Recovery Test): … where systems are taken down with little or no notice to verify that all the failure protection systems work => Monitoring
  • 20. Distributed Systems - Stability Patterns Avoid (cascading) failures: ● Timeouts ● Circuit breakers ● Bulkheads ● Retry (Exponential back-off, Idempotent!) ● Throttling
  • 21. Deployment ● Build Pipelines and Continuous Delivery ○ Any commit represents a potential release ● Infrastructure automation!!! ○ Immutable infrastructure ○ Infrastructure as Code ○ Ansible, Terraform At Visma: AWS test env. -> AWS staging env. ->AWS production env.
  • 22. Team and Organization ● “Microservices” is a organizational change! ● Independent (decentralized) teams who fully own their services: ○ Requirements/Specifications ○ Source code ○ Quality ○ Deployment ○ Technology selection ?! ● Cross functional teams Conway’s Law (1967)
  • 23. Security ● Service to service Authorization and Authentication (service accounts?) ○ Allow? operations (inside) to an internal service ● Single Sign-On ○ SAML ○ OAuth2, Open ID ○ LDAP ● Client-side certificates ● API Keys Considerable increase of surface attacks!
  • 24. Logging ● Push logs outside service! ● Correlation IDs ● Log Aggregation (Logstash, Fluentd, Kibana, ...) ● Standardize log message format AWS CloudWatch
  • 25. Monitoring ● Inside services ○ Memory usage ○ CPU usage ○ SQL queries per minute ● Incoming to service ○ Request rate (# requests per second) ○ Error rate ○ Service latency ● Health checks (service itself + downstream services) ● Implement Alerts! AWS CloudWatch, AppDynamics, OpsGenie
  • 26. Monolith Microservices Business Agility Low High Team technical knowledge Good Higher Complexity High (coupled dependencies!) Reasonable Scalability Vertical Horizontal API Poor quality, optional? Good if done right, mandatory Frontend (UI) Complexity Medium Higher Deployment Manual? - Entire application CD - by service Logging In one place (good) Distributed Monitoring Not necessary: all or nothing Distributed systems => Necessary! End to end testing Relatively easy Complicated DevOps Complicated Easy
  • 27. Takeaway Microservices: Small autonomous services which work together, modelled around a business domain Sometimes the necessary step! Add a lot of complexity!