SlideShare a Scribd company logo
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.

More Related Content

What's hot

OpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote SlidesOpenStack Tokyo Summit Keynote Slides
OpenStack Tokyo Summit Keynote Slides
mestery
 
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 Openstack
salv_orlando
 
Coscup SDN workshop - mininet
Coscup SDN workshop - mininetCoscup SDN workshop - mininet
Coscup SDN workshop - mininet
HungWei 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 Architect
James Denton
 
Troubleshooting Tracebacks
Troubleshooting TracebacksTroubleshooting Tracebacks
Troubleshooting Tracebacks
James Denton
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch Introduction
HungWei Chiu
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNet
Taku Fukushima
 
An Introduction to OpenStack Networking
An Introduction to OpenStack NetworkingAn Introduction to OpenStack Networking
An Introduction to OpenStack Networking
Scott 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 to
salv_orlando
 
Netty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/ConnectivityNetty @Apple: Large Scale Deployment/Connectivity
Netty @Apple: Large Scale Deployment/Connectivity
C4Media
 
The Open vSwitch and OVN Projects
The Open vSwitch and OVN ProjectsThe Open vSwitch and OVN Projects
The Open vSwitch and OVN Projects
LinuxCon ContainerCon CloudOpen China
 
Sdn command line controller lab
Sdn command line controller labSdn command line controller lab
Sdn command line controller lab
Guedda houssem eddin
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & Asterisk
Evan McGee
 
Status of Embedded Linux
Status of Embedded LinuxStatus of Embedded Linux
Status of Embedded Linux
LinuxCon ContainerCon CloudOpen China
 
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
Vietnam Open Infrastructure User Group
 
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
James Denton
 
Open Source Backends for OpenStack Neutron
Open Source Backends for OpenStack NeutronOpen Source Backends for OpenStack Neutron
Open Source Backends for OpenStack Neutron
mestery
 
Ovn vancouver
Ovn vancouverOvn vancouver
Ovn vancouver
Mason 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
 

What's hot (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 ...
 

Similar to Breaking down a monolith

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
 
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
 
Microservices
MicroservicesMicroservices
Microservices
NewsCred Dhaka
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
Žilvinas Kuusas
 
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'2020
OdessaJS 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 action
Mukesh 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 Turskyi
Julia 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 infrastructure
Yshay Yaacobi
 
Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6
Tricode (part of Dept)
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
Miki 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 perspective
Walid Shaari
 
Refactoring the monolith
Refactoring the monolithRefactoring the monolith
Refactoring the monolith
Steven Hicks
 
Building a Small DC
Building a Small DCBuilding a Small DC
Building a Small DC
APNIC
 
Building a Small Datacenter
Building a Small DatacenterBuilding a Small Datacenter
Building a Small Datacenter
ssuser4b98f0
 
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
Anatole Tresch
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
Pavel Mička
 
Microservice
MicroserviceMicroservice
Microservice
Viney Shih
 
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
Safaridin Salim
 

Similar to Breaking down a monolith (20)

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 ...
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
 
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
 

More from GeekNightHyderabad

Testing strategies in microservices
Testing strategies in microservicesTesting strategies in microservices
Testing strategies in microservices
GeekNightHyderabad
 
Metaprogramming ruby
Metaprogramming rubyMetaprogramming ruby
Metaprogramming ruby
GeekNightHyderabad
 
Scaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetesScaling enterprise digital platforms with kubernetes
Scaling enterprise digital platforms with kubernetes
GeekNightHyderabad
 
FreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networksFreedomBox & Community Wi-Fi networks
FreedomBox & Community Wi-Fi networks
GeekNightHyderabad
 
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 industry
GeekNightHyderabad
 
Design lean agile_thinking presentation
Design lean agile_thinking presentationDesign lean agile_thinking presentation
Design lean agile_thinking presentation
GeekNightHyderabad
 
Scaling pipelines
Scaling pipelinesScaling pipelines
Scaling pipelines
GeekNightHyderabad
 
Blockchain beyond bitcoin
Blockchain beyond bitcoinBlockchain beyond bitcoin
Blockchain beyond bitcoin
GeekNightHyderabad
 
Http/2
Http/2Http/2
Hardware hacking and internet of things
Hardware hacking and internet of thingsHardware hacking and internet of things
Hardware hacking and internet of things
GeekNightHyderabad
 
Spring to Cloud - REST To Microservices
Spring to Cloud - REST To MicroservicesSpring to Cloud - REST To Microservices
Spring to Cloud - REST To Microservices
GeekNightHyderabad
 
Serverless
ServerlessServerless
Serverless
GeekNightHyderabad
 
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
GeekNightHyderabad
 
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
GeekNightHyderabad
 
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
GeekNightHyderabad
 
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
GeekNightHyderabad
 
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
GeekNightHyderabad
 
Understanding the Intelligent Cloud
Understanding the Intelligent CloudUnderstanding the Intelligent Cloud
Understanding the Intelligent Cloud
GeekNightHyderabad
 
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
GeekNightHyderabad
 

More from 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
 

Recently uploaded

Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 

Recently uploaded (20)

Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 

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.

Editor's Notes

  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.