SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Akos, Anil, Chandan
● Overview: Monoliths & Microservices
● Case Study 1 – Gradual migration
● Case Study 2 – Big Bang
Agenda
Overview:
Monoliths & Microservices
What is a Monolith?
A monolith is...
● ...an architecture style
● ...a way that your code
and business logic is
structured
● ...usually a single code-
base
● ...usually you can
deploy everything or
nothing
Image source: https://www.slashroot.in/difference-between-monolithic-and-microservices-based-architecture
Is a monolith bad?
It depends!
vs.
Image source: https://tech.findmypast.com/extracting-a-microservice-from-a-monolith/
Monoliths pros/cons
● Calls are inter-process
● Simple development
● Simple testing
● Simple deployments
● Simple infrastructure
● Lack of domain boundaries
● Single technology stack
● Difficult to change
● Slow build/test times
● Slow QA process
Most common issue:
Monoliths don’t scale
Most common issue:
Monoliths don’t scale
In terms of dev process
Where monoliths break down
● Large development teams (>20 devs)
● Lack of developer discipline
● Each change means that you need a full QA
● Bugs/issues break everything
● Rollbacks cause a bottleneck
● Lack of domain boundaries means it’s hard to upkeep a
good internal architecture
What you end up with
Image source: https://tech.findmypast.com/extracting-a-microservice-from-a-monolith/
Signs of a good monolith
● Strong, comprehensive, and quick test suite
● Requires no/minimal manual QA
● Can be deployed many times a day
● Internally structures code into modules
○ Domain Driven Design
What is a
microservice?
A microservice is...
● ...small enough
● ...not too large
● ...a single domain
● ...can be deployed on
its own
● ...owns its own data
Image source: https://spring.io/blog/2015/07/14/microservices-with-spring
Examples of microservices
● Email service
● Payments service
● Push notifications service
● Chat service
● Authentication service
The Distributed Monolith
Image source: https://www.programmableweb.com/news/tools-to-monitor-and-visualize-microservices-architecture/analysis/2016/12/14
Microservice pros/cons
● Clear boundaries
● Smaller teams
● Deploy in isolation
● Diverse technologies
● Scalable
● Complex infrastructure
● Network calls
● Distributed systems
● Difficult integration testing
● Difficult cross-domain changes
● Difficult local development
Microservices are
not a silver bullet
Distributed systems
Distributed systems
The 8 fallacies of distributed computing
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 https://www.rgoarchitects.com/Files/fallacies.pdf
Performance
● Typically decreases
● Inter-process calls: 0.1–1 ns
● Network calls: 10–900 ms (or killed after ~60 seconds)
● Many sequential network calls stack up
● gRPC can help instead of HTTP
Distributed transactions
● You can’t commit a single DB transaction anymore
● Many HTTP calls that don’t form a transaction
● What if one call fails, but the other succeed?
○ Sagas or event-driven architectures can help
Sagas
Image source: https://blog.bernd-ruecker.com/saga-how-to-implement-complex-business-transactions-without-two-phase-commit-e00aa41a1b1b
Testing
● Testing inside a microservice is easy
● Testing all interactions between microservices is hard
DevOps culture
● DevOps culture is required
● You build it, you run it
● Infrastructure complexity:
Service orchestration
Service discovery
Load balancing
Distributed logging
Distributed tracing
Retry strategies
Circuit breaking
Back pressure
Rate limiting
Metrics collection
A/B testing
Fault injection
Chaos engineering
Alerting
Health checking
Infrastructure
The good sides of
microservices
API contracts
● API-first design
● Harder to change
○ Need to think about it a bit more
● Backwards compatibility is a must
● Implementation does not matter
Forces Bounded Contexts
● Domain Driven Design
● Each service is responsible for one domain
● The service usually is a Bounded Context
Failures are contained
● Each domain can be releasing/rolling back features
independently
● Results in agility
● But: failures can also cascade!
So where does that
leave us?
Rule of thumb
● Think! — use your brain!
● Start with monoliths
○ Cheaper/quicker setup
○ Simpler to deliver business value
● Refactor into microservices later
○ Team has grown to a considerable size
○ Some functions need better performance
How do we break down a monolith?
Questions
Case Study 1
● Problem Statement
● Backend Separation
○ Two-phased approach
● UI Separation
○ Embedding the monolith UI into React
● Infrastructure
The Monolith
● Ruby on Rails
● 160 tables
● 380 server-side views
● 180 API endpoints
Problem Statement
● Break out one domain, promotions, from the monolith
● Recreate the UI with an improved UX for this domain
Promotions
Domain
● 45 fields in the table
● 30 relationships with
other schemas
● 100 of 380 server-side
views
● 50 of 180 API
endpoints
Backend Separation
Monolith
API Gateway
Web iOS Android
The Monolith
Emails
Notifications
160 tables
380 views 180 API
endpoints
Promotions
µS
API Gateway
Web iOS Android
Phase 1
● Separate business logic
into a new microservice
● µS uses the monolith
datastore
● µS serves the web portal
users
● Monolith continues
serving mobile apps
● Monolith exposes new
APIs for other domains
Emails
Notifications
Monolith
Emails
Notifications
Promotions
µS
API Gateway
Web iOS Android
Phase 2
● All traffic hits µS
● µS has its own
datastore
● µS still relies on the
monolith for some
domains
● Monolith relies on µS
for promotions domain
Emails
Notifications
Monolith
Promotions
Data
Other
domains
UI Separation
Legacy app in an iframe
Modern React container
UI Separation
● Render new windows using React components
● Remove all server-side rendered pages from the domain
● Use GraphQL to hook up µS APIs with legacy
Infrastructure
● Deployment via Kubernetes
● Logging and alerting
● Tracing a request across multiple services
● Service to service authentication
Working on...
● Handling distributed transactions and rollback
scenarios
● Data migration
Questions
Case Study 2
● UI Separation
● Backend Separation
● Data Migration
○ Event-based triggers
○ Two user groups
● Two user groups
● Oracle ATG e-
commerce
● One database for read-
write
● Endeca search/
discovery tool for data
● Endeca indexes the
data for search
Endeca
Product
Inventory
Order
Management
Category
UI
Monolith
Architecture
User ProfilePromotions
Adornments
ProductsCategory
SKUs Recommendations
ATG
DB
● ATG DB update
triggers an event
to RabbitMQ
● RabbitMQ sends
event based
triggers to service
● Services listen to
particular events
and store it into ES
● Different queues
for the different
kinds of message
ATG
DB
DATABASE
TRIGGERS
UI
Product Listing Product Display
Products SKU Promotions User Profile
Category
Category
New UI
ATG
µS
µS
µS
µS
µS
µS
µS
µS
µS
Questions
Go break a monolith
Go break a monolith
If you must.

Weitere ähnliche Inhalte

Was ist angesagt?

OpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote SlidesOpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote Slidesmestery
 
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...nvirters
 
Quantum - Virtual networks for Openstack
Quantum - Virtual networks for OpenstackQuantum - Virtual networks for Openstack
Quantum - Virtual networks for Openstacksalv_orlando
 
Coscup SDN workshop - mininet
Coscup SDN workshop - mininetCoscup SDN workshop - mininet
Coscup SDN workshop - mininetHungWei Chiu
 
DevOops - Lessons Learned from an OpenStack Network Architect
DevOops - Lessons Learned from an OpenStack Network ArchitectDevOops - Lessons Learned from an OpenStack Network Architect
DevOops - Lessons Learned from an OpenStack Network ArchitectJames Denton
 
Troubleshooting Tracebacks
Troubleshooting TracebacksTroubleshooting Tracebacks
Troubleshooting TracebacksJames Denton
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch IntroductionHungWei Chiu
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNetTaku Fukushima
 
An Introduction to OpenStack Networking
An Introduction to OpenStack NetworkingAn Introduction to OpenStack Networking
An Introduction to OpenStack NetworkingScott Lowe
 
How to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need toHow to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need tosalv_orlando
 
Netty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/ConnectivityNetty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/ConnectivityC4Media
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & AsteriskEvan McGee
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge MigrationJames Denton
 
Open Source Backends for OpenStack Neutron
Open Source Backends for OpenStack NeutronOpen Source Backends for OpenStack Neutron
Open Source Backends for OpenStack Neutronmestery
 
Ovn vancouver
Ovn vancouverOvn vancouver
Ovn vancouverMason Mei
 
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...Cisco DevNet
 

Was ist angesagt? (20)

OpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote SlidesOpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote Slides
 
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
 
Quantum - Virtual networks for Openstack
Quantum - Virtual networks for OpenstackQuantum - Virtual networks for Openstack
Quantum - Virtual networks for Openstack
 
Coscup SDN workshop - mininet
Coscup SDN workshop - mininetCoscup SDN workshop - mininet
Coscup SDN workshop - mininet
 
DevOops - Lessons Learned from an OpenStack Network Architect
DevOops - Lessons Learned from an OpenStack Network ArchitectDevOops - Lessons Learned from an OpenStack Network Architect
DevOops - Lessons Learned from an OpenStack Network Architect
 
Troubleshooting Tracebacks
Troubleshooting TracebacksTroubleshooting Tracebacks
Troubleshooting Tracebacks
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch Introduction
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNet
 
An Introduction to OpenStack Networking
An Introduction to OpenStack NetworkingAn Introduction to OpenStack Networking
An Introduction to OpenStack Networking
 
How to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need toHow to write a Neutron Plugin - if you really need to
How to write a Neutron Plugin - if you really need to
 
Netty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/ConnectivityNetty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/Connectivity
 
The Open vSwitch and OVN Projects
The Open vSwitch and OVN ProjectsThe Open vSwitch and OVN Projects
The Open vSwitch and OVN Projects
 
Sdn command line controller lab
Sdn command line controller labSdn command line controller lab
Sdn command line controller lab
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & Asterisk
 
Status of Embedded Linux
Status of Embedded LinuxStatus of Embedded Linux
Status of Embedded Linux
 
Meetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStackMeetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStack
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
 
Open Source Backends for OpenStack Neutron
Open Source Backends for OpenStack NeutronOpen Source Backends for OpenStack Neutron
Open Source Backends for OpenStack Neutron
 
Ovn vancouver
Ovn vancouverOvn vancouver
Ovn vancouver
 
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...
OpenStack and OpenDaylight, The Evolving Relationship in Cloud Networking: a ...
 

Ähnlich wie Breaking down a monolith

The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийSigma Software
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...Viktor Turskyi
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Fwdays
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020OdessaJS Conf
 
Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionMukesh Singh
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor TurskyiJulia Cherniak
 
2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)roblund
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureYshay Yaacobi
 
Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Tricode (part of Dept)
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveWalid Shaari
 
Refactoring the monolith
Refactoring the monolithRefactoring the monolith
Refactoring the monolithSteven Hicks
 
Building a Small DC
Building a Small DCBuilding a Small DC
Building a Small DCAPNIC
 
Building a Small Datacenter
Building a Small DatacenterBuilding a Small Datacenter
Building a Small Datacenterssuser4b98f0
 
Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenAnatole Tresch
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best PracticesPavel Mička
 
How to move from Monolith to Microservice
How to move from Monolith to MicroserviceHow to move from Monolith to Microservice
How to move from Monolith to MicroserviceSafaridin Salim
 

Ähnlich wie Breaking down a monolith (20)

The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
 
Microservices
MicroservicesMicroservices
Microservices
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
 
Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in action
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
 
2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)2 years into drinking the Microservice kool-aid (Fact and Fiction)
2 years into drinking the Microservice kool-aid (Fact and Fiction)
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
 
Refactoring the monolith
Refactoring the monolithRefactoring the monolith
Refactoring the monolith
 
Building a Small DC
Building a Small DCBuilding a Small DC
Building a Small DC
 
Building a Small Datacenter
Building a Small DatacenterBuilding a Small Datacenter
Building a Small Datacenter
 
Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmen
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
Microservice
MicroserviceMicroservice
Microservice
 
How to move from Monolith to Microservice
How to move from Monolith to MicroserviceHow to move from Monolith to Microservice
How to move from Monolith to Microservice
 

Mehr von GeekNightHyderabad

Testing strategies in microservices
Testing strategies in microservicesTesting strategies in microservices
Testing strategies in microservicesGeekNightHyderabad
 
Scaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetesScaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetesGeekNightHyderabad
 
FreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networksFreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networksGeekNightHyderabad
 
Rendezvous with aucovei (autonomous connected car)
Rendezvous with aucovei (autonomous connected car)Rendezvous with aucovei (autonomous connected car)
Rendezvous with aucovei (autonomous connected car)GeekNightHyderabad
 
Role of AI & ML in beauty care industry
Role of AI & ML in beauty care industryRole of AI & ML in beauty care industry
Role of AI & ML in beauty care industryGeekNightHyderabad
 
Design lean agile_thinking presentation
Design lean agile_thinking presentationDesign lean agile_thinking presentation
Design lean agile_thinking presentationGeekNightHyderabad
 
Hardware hacking and internet of things
Hardware hacking and internet of thingsHardware hacking and internet of things
Hardware hacking and internet of thingsGeekNightHyderabad
 
Spring to Cloud - REST To Microservices
Spring to Cloud - REST To MicroservicesSpring to Cloud - REST To Microservices
Spring to Cloud - REST To MicroservicesGeekNightHyderabad
 
Building Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring CloudBuilding Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring CloudGeekNightHyderabad
 
Progressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web TechnologiesProgressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web TechnologiesGeekNightHyderabad
 
Scaling a Game Server: From 500 to 100,000 Users
Scaling a Game Server: From 500 to 100,000 UsersScaling a Game Server: From 500 to 100,000 Users
Scaling a Game Server: From 500 to 100,000 UsersGeekNightHyderabad
 
Big Data - Need of Converged Data Platform
Big Data - Need of Converged Data PlatformBig Data - Need of Converged Data Platform
Big Data - Need of Converged Data PlatformGeekNightHyderabad
 
Building a Data Lake - An App Dev's Perspective
Building a Data Lake - An App Dev's PerspectiveBuilding a Data Lake - An App Dev's Perspective
Building a Data Lake - An App Dev's PerspectiveGeekNightHyderabad
 
Understanding the Intelligent Cloud
Understanding the Intelligent CloudUnderstanding the Intelligent Cloud
Understanding the Intelligent CloudGeekNightHyderabad
 
GeekNight 22.0 Multi-paradigm programming in Scala and Akka
GeekNight 22.0 Multi-paradigm programming in Scala and AkkaGeekNight 22.0 Multi-paradigm programming in Scala and Akka
GeekNight 22.0 Multi-paradigm programming in Scala and AkkaGeekNightHyderabad
 

Mehr von GeekNightHyderabad (20)

Testing strategies in microservices
Testing strategies in microservicesTesting strategies in microservices
Testing strategies in microservices
 
Metaprogramming ruby
Metaprogramming rubyMetaprogramming ruby
Metaprogramming ruby
 
Scaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetesScaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetes
 
FreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networksFreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networks
 
Rendezvous with aucovei (autonomous connected car)
Rendezvous with aucovei (autonomous connected car)Rendezvous with aucovei (autonomous connected car)
Rendezvous with aucovei (autonomous connected car)
 
Role of AI & ML in beauty care industry
Role of AI & ML in beauty care industryRole of AI & ML in beauty care industry
Role of AI & ML in beauty care industry
 
Design lean agile_thinking presentation
Design lean agile_thinking presentationDesign lean agile_thinking presentation
Design lean agile_thinking presentation
 
Scaling pipelines
Scaling pipelinesScaling pipelines
Scaling pipelines
 
Blockchain beyond bitcoin
Blockchain beyond bitcoinBlockchain beyond bitcoin
Blockchain beyond bitcoin
 
Http/2
Http/2Http/2
Http/2
 
Hardware hacking and internet of things
Hardware hacking and internet of thingsHardware hacking and internet of things
Hardware hacking and internet of things
 
Spring to Cloud - REST To Microservices
Spring to Cloud - REST To MicroservicesSpring to Cloud - REST To Microservices
Spring to Cloud - REST To Microservices
 
Serverless
ServerlessServerless
Serverless
 
Building Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring CloudBuilding Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring Cloud
 
Progressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web TechnologiesProgressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web Technologies
 
Scaling a Game Server: From 500 to 100,000 Users
Scaling a Game Server: From 500 to 100,000 UsersScaling a Game Server: From 500 to 100,000 Users
Scaling a Game Server: From 500 to 100,000 Users
 
Big Data - Need of Converged Data Platform
Big Data - Need of Converged Data PlatformBig Data - Need of Converged Data Platform
Big Data - Need of Converged Data Platform
 
Building a Data Lake - An App Dev's Perspective
Building a Data Lake - An App Dev's PerspectiveBuilding a Data Lake - An App Dev's Perspective
Building a Data Lake - An App Dev's Perspective
 
Understanding the Intelligent Cloud
Understanding the Intelligent CloudUnderstanding the Intelligent Cloud
Understanding the Intelligent Cloud
 
GeekNight 22.0 Multi-paradigm programming in Scala and Akka
GeekNight 22.0 Multi-paradigm programming in Scala and AkkaGeekNight 22.0 Multi-paradigm programming in Scala and Akka
GeekNight 22.0 Multi-paradigm programming in Scala and Akka
 

Kürzlich hochgeladen

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Kürzlich hochgeladen (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
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...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Breaking down a monolith

  • 2. ● Overview: Monoliths & Microservices ● Case Study 1 – Gradual migration ● Case Study 2 – Big Bang Agenda
  • 4. What is a Monolith?
  • 5. A monolith is... ● ...an architecture style ● ...a way that your code and business logic is structured ● ...usually a single code- base ● ...usually you can deploy everything or nothing Image source: https://www.slashroot.in/difference-between-monolithic-and-microservices-based-architecture
  • 7. It depends! vs. Image source: https://tech.findmypast.com/extracting-a-microservice-from-a-monolith/
  • 8. Monoliths pros/cons ● Calls are inter-process ● Simple development ● Simple testing ● Simple deployments ● Simple infrastructure ● Lack of domain boundaries ● Single technology stack ● Difficult to change ● Slow build/test times ● Slow QA process
  • 10. Most common issue: Monoliths don’t scale In terms of dev process
  • 11. Where monoliths break down ● Large development teams (>20 devs) ● Lack of developer discipline ● Each change means that you need a full QA ● Bugs/issues break everything ● Rollbacks cause a bottleneck ● Lack of domain boundaries means it’s hard to upkeep a good internal architecture
  • 12. What you end up with Image source: https://tech.findmypast.com/extracting-a-microservice-from-a-monolith/
  • 13. Signs of a good monolith ● Strong, comprehensive, and quick test suite ● Requires no/minimal manual QA ● Can be deployed many times a day ● Internally structures code into modules ○ Domain Driven Design
  • 15. A microservice is... ● ...small enough ● ...not too large ● ...a single domain ● ...can be deployed on its own ● ...owns its own data Image source: https://spring.io/blog/2015/07/14/microservices-with-spring
  • 16. Examples of microservices ● Email service ● Payments service ● Push notifications service ● Chat service ● Authentication service
  • 17. The Distributed Monolith Image source: https://www.programmableweb.com/news/tools-to-monitor-and-visualize-microservices-architecture/analysis/2016/12/14
  • 18. Microservice pros/cons ● Clear boundaries ● Smaller teams ● Deploy in isolation ● Diverse technologies ● Scalable ● Complex infrastructure ● Network calls ● Distributed systems ● Difficult integration testing ● Difficult cross-domain changes ● Difficult local development
  • 19. Microservices are not a silver bullet
  • 22. The 8 fallacies of distributed computing 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 https://www.rgoarchitects.com/Files/fallacies.pdf
  • 23. Performance ● Typically decreases ● Inter-process calls: 0.1–1 ns ● Network calls: 10–900 ms (or killed after ~60 seconds) ● Many sequential network calls stack up ● gRPC can help instead of HTTP
  • 24. Distributed transactions ● You can’t commit a single DB transaction anymore ● Many HTTP calls that don’t form a transaction ● What if one call fails, but the other succeed? ○ Sagas or event-driven architectures can help
  • 26. Testing ● Testing inside a microservice is easy ● Testing all interactions between microservices is hard
  • 27. DevOps culture ● DevOps culture is required ● You build it, you run it ● Infrastructure complexity: Service orchestration Service discovery Load balancing Distributed logging Distributed tracing Retry strategies Circuit breaking Back pressure Rate limiting Metrics collection A/B testing Fault injection Chaos engineering Alerting Health checking
  • 29. The good sides of microservices
  • 30. API contracts ● API-first design ● Harder to change ○ Need to think about it a bit more ● Backwards compatibility is a must ● Implementation does not matter
  • 31. Forces Bounded Contexts ● Domain Driven Design ● Each service is responsible for one domain ● The service usually is a Bounded Context
  • 32. Failures are contained ● Each domain can be releasing/rolling back features independently ● Results in agility ● But: failures can also cascade!
  • 33. So where does that leave us?
  • 34. Rule of thumb ● Think! — use your brain! ● Start with monoliths ○ Cheaper/quicker setup ○ Simpler to deliver business value ● Refactor into microservices later ○ Team has grown to a considerable size ○ Some functions need better performance
  • 35. How do we break down a monolith?
  • 37. Case Study 1 ● Problem Statement ● Backend Separation ○ Two-phased approach ● UI Separation ○ Embedding the monolith UI into React ● Infrastructure
  • 38. The Monolith ● Ruby on Rails ● 160 tables ● 380 server-side views ● 180 API endpoints
  • 39. Problem Statement ● Break out one domain, promotions, from the monolith ● Recreate the UI with an improved UX for this domain
  • 40. Promotions Domain ● 45 fields in the table ● 30 relationships with other schemas ● 100 of 380 server-side views ● 50 of 180 API endpoints
  • 42. Monolith API Gateway Web iOS Android The Monolith Emails Notifications 160 tables 380 views 180 API endpoints
  • 43. Promotions µS API Gateway Web iOS Android Phase 1 ● Separate business logic into a new microservice ● µS uses the monolith datastore ● µS serves the web portal users ● Monolith continues serving mobile apps ● Monolith exposes new APIs for other domains Emails Notifications Monolith Emails Notifications
  • 44. Promotions µS API Gateway Web iOS Android Phase 2 ● All traffic hits µS ● µS has its own datastore ● µS still relies on the monolith for some domains ● Monolith relies on µS for promotions domain Emails Notifications Monolith Promotions Data Other domains
  • 46.
  • 47. Legacy app in an iframe Modern React container
  • 48. UI Separation ● Render new windows using React components ● Remove all server-side rendered pages from the domain ● Use GraphQL to hook up µS APIs with legacy
  • 49. Infrastructure ● Deployment via Kubernetes ● Logging and alerting ● Tracing a request across multiple services ● Service to service authentication
  • 50. Working on... ● Handling distributed transactions and rollback scenarios ● Data migration
  • 52. Case Study 2 ● UI Separation ● Backend Separation ● Data Migration ○ Event-based triggers ○ Two user groups
  • 53. ● Two user groups ● Oracle ATG e- commerce ● One database for read- write ● Endeca search/ discovery tool for data ● Endeca indexes the data for search Endeca Product Inventory Order Management Category UI Monolith Architecture User ProfilePromotions Adornments ProductsCategory SKUs Recommendations ATG DB
  • 54. ● ATG DB update triggers an event to RabbitMQ ● RabbitMQ sends event based triggers to service ● Services listen to particular events and store it into ES ● Different queues for the different kinds of message ATG DB DATABASE TRIGGERS UI Product Listing Product Display Products SKU Promotions User Profile Category Category
  • 57. Go break a monolith
  • 58. Go break a monolith If you must.

Hinweis der Redaktion

  1. Started three months ago Phased approach The first phase should be in production later this year
  2. One consideration while creating new APIs–assume they will also be carved out into separate microservices.
  3. Which is a highly customizable, configurable framework for building and supporting Web sites, particularly sites used for e-commerce.