SlideShare a Scribd company logo
@betoSalazar
Nowadays Architecture Trends,
from Monolith to Microservices and Serverless
by Alberto Salazar,
Oracle Groundbreaker Ambassador
Java Champion
Auth0 Ambassador
August 2019
GB Tour Latam 2019
#GroundbreakersTour
Alberto Salazar
@betoSalazar
www.advlatam.com
www.cloudbanco.com
www.ecuadorjug.org www.javaday.ec
● Author
● Speaker
● Community
● Java Champion
● Groundbreaker
● Auth0 Ambassador
● Chief Advance Latam
How I get experience?
@betoSalazar
The monolith is our legacy ?
Source: 97 Things Every Software Architect Should Know
@betoSalazar
The monolith is our legacy ?
The journey
● Overview Monolith - Microservices - Serverless
● Monolith in real life
● Microservices really?
● Third party services and Serverless
● Tips, tricks, pros, cons & code
asalazar@advlatam.com
@betoSalazar
Architecture Trends
Overview Monolith - Microservices - Serverless
GB Tour Latam 2019
#GroundbreakersTour
Monolith = Legacy ?
@betoSalazar
Application Server
MONOLITH (EAR | WAR | JAR)
Servlets
EJBs
JPA
Balancer
Monolith = Legacy ?
@betoSalazar
Application Server
MONOLITH (EAR | WAR | JAR)
Servlets
EJBs
JPA
Balancer
Customer Payments Loans
Funds
Transfer
N…1 N…
Monolith = Legacy ?
@betoSalazar
Application Server
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
Balancer
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
MONOLITH (EAR |
WAR | JAR)
Servlets
EJBs
JPA
Monolith = Legacy ?
@betoSalazar
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Application Server
Microservicios
(EAR | WAR |
JAR)
Servlets
EJBs
JPA
Monolith = Legacy ?
Characteristics
! Attachment to the environment(language, platform & OS)
! Single logical executable, deploy everything at once or nothing at all
! Bottlenecks and Failure of part == failure of whole
! Take months even years getting into production
! Centralized authority slows the delivery process (DBA, OPS, QA)
! Coordinated releases are hard, because brings many changes
together from different teams
@betoSalazar
asalazar@advlatam.com
@betoSalazar
The Monolith in real life
GB Tour Latam 2019
#GroundbreakersTour
Around 2000s
Monolith: How it looks
What is the problem ?What is the problem ?
Around 2000s
What is the problem ?What is the problem ?
@betoSalazar
Grow the code and the team
What is the problem ?What is the problem ?
@betoSalazar
Modular really ?
Monolith: How it looks -> A huge EAR file
@betoSalazar
More than 10 Years of code
OMG
@betoSalazar
@betoSalazar
The experience
Transactions Scale all or nothing
Fail all or nothing
Cost of maintenance
Coordinate releases
Trace and log
Only one tech stack
Nowadays Architecture Trends
The Monolith vs Microservices
How it looks
http://microservices.io/patterns/monolithic.html http://microservices.io/patterns/microservices.html
@betoSalazar
Microservices
Characteristics
! Deployable, executable & scaled independently
! Smaller code modules are easier to understand
! High cohesion, low coupling
! Failure is isolated (Fail one part of the system)
! Independent Teams (decide their own
architecture)
! Polyglot “Plus”
https://martinfowler.com/articles/microservices.html
https://martinfowler.com/bliki/MicroservicePrerequisites.html
@betoSalazar
Serverless
Serverless
! Developers code business logic as functions
! Forgetting everything about the servers
provisioning and scaling concerns where the
logic will be executed
! Ephimeral
! Multicloud, get the best from each one (AWS,
Oracle Cloud, Google Cloud, AWS, Azure, etc)
! Troubleshooting is hard
@betoSalazar
Monolith vs Microservices vs Serverless
Monolith Microservices Serverless
asalazar@advlatam.com
@betoSalazar
Microservices really ?
GB Tour Latam 2019
#GroundbreakersTour
Microservices really ?
The plan of move forward (Microservices -> cloud -> serverless ?)
Everybody are talking about the result (microservices architectural style)
but just a few are showing the painpath
@betoSalazar
The Monolith to Microservices
How it looks
http://microservices.io/patterns/monolithic.html http://microservices.io/patterns/microservices.html
@betoSalazar
Microservices really ?
@betoSalazar
Move to Microservices my experience
@betoSalazar
!Split and establish interfaces (Test)
!Reuse business logic (Test)
!Move in parts the frontend (Evolve)
!Rewrite or refactor the backend (Test)
!Cultural evolution (CI - CD - DevOps)
JEE application server (JBoss or WL or WAS)
banking-web.ear
backoffice-web.ear
accounts.ear
loans.ear
customers.ear
The Monolith to Microservices
The Monolith
1 to n modules
Http
Web
Server
@betoSalazar
JEE application server
The Monolith
Database
JEE application server
theApp.ear
MODULE1.war
MODULE1-JS.jar
MODULE2.war
MODULE3.war
css.war
MODULE4.war
businesslogic.jar
businesslogic.jar
businesslogic.jar
businesslogic.jar
@betoSalazar
The Monolith to MicroservicesThe Monolith to Microservices
Split the backend
https://projects.spring.io/spring-boot/
https://microprofile.io/
https://vertx.io/
https://www.docker.com/
https://github.com/fabric8io/docker-maven-plugin
https://github.com/spotify/docker-maven-plugin
Spring boot
install just
what you need
in a Docker
Container
Osgi container
engine-orchestrator.jar
Osgi container
dynamic-camel-routes.jar
fat jar
batch.jar
fat jar
services.jar
fat jar
business-module1.jar
fat jar
business-module-n.jar
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
@betoSalazar
The Monolith to Microservices
Logging, trace & Monitoring
http://www.baeldung.com/mdc-in-log4j-2-logback
https://www.elastic.co/products/elasticsearch
https://www.elastic.co/products/logstash
https://www.elastic.co/products/kibana
logstash
1) Use Mapped Diagnostic Context (MDC)
Enrich log files
2) Introduce a correlationId
3) Collect the logs
4) Search by rest API or use Kibana
Osgi container
engine-orchestrator.jar
Osgi container
dynamic-camel-routes.jar
fat jar
batch.jar
fat jar
services.jar
fat jar
business-module1.jar
fat jar
business-module-n.jar
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
businesslogic.jar
consumer.jar
Monolith to Microservices -> Split the frontend from the backend
@betoSalazar
Microservices
Domain based services
@betoSalazar
Microservices or Modules or Microliths
We already split our monolith or we are on it
https://jwt.io/
https://nodejs.org/es/
https://facebook.github.io/react/
https://angular.io/
https://facebook.github.io/react-native/
fat jar
api-gateway.jar
Services
api rest
POST bank.com/api/v1/accouts
POST bank.com/api/v1/accouts
logstash
Login
Angular nodejs
Transaction
Angular nodejs
Module n
Angular nodejs
Osgi container
engine-orchestrator.jar
Osgi container
dynamic-camel-routes.jar
fat jar
batch.jar
fat jar
services.jar
fat jar
business-module1.jar
fat jar
business-module-n.jar
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
JWT
JSON WEB TOKEN
&
Authorization Server
Containers - Orchestrators - Cloud Istio: Service Mesh
Containers (Docker) ->
Manage the same code + environment in diferente stages
Orchestrators (Kubernetes, Docker Swarm, Mesos) ->
We need to orchestrated our containers
Cloud (eg. Oracle Cloud, Google Cloud, AWS, Azure, Bluemix)
@betoSalazar
The cost of communication over the
network is not trivial.
@betoSalazar
The experience
It’s hard to trace the thread of execution in a
distributed system.
@betoSalazar
The experience
Eventual consistency ?
@betoSalazar
The experience
The cost of development goes up.
@betoSalazar
The experience
Do you depend on a Monolith ?
Provably we will have Bottlenecks
@betoSalazar
Do you have an automation pipeline process ?
DELIVERY PIPELINE
CI / CD
CODE BUILD TEST DEPLOY
CODE ANALYZE (Quality and security)
If your answer is not, do it before
microservices
@betoSalazar
@betoSalazar
The experience
2 phase commitScaling
Fail in parts
More tech stack
Trace and logging
Polyglot
Easy to understand
Lose Single data repo
asalazar@advlatam.com
@betoSalazar
Serverless
FaaS, Backend as Services
Third party services
GB Tour Latam 2019
#GroundbreakersTour
Serverless
Serverless
! Developers code business logic as functions
! Forgetting everything about the servers
provisioning and scaling concerns where the
logic will be executed
! Ephimeral
! Multicloud, get the best from each one (AWS,
Oracle Cloud, Google Cloud, AWS, Azure, etc)
! Troubleshooting is hard
@betoSalazar
https://cloud.spring.io/spring-cloud-function/
Spring Cloud Functions
FaaS
! Promote the implementation of business logic
via functions
! Adapters for
• AWS Lambda,
• Microsoft Azure,
• Apache OpenWhisk
• and possibly other "serverless"
service providers.
@betoSalazar
The cost consideration
@betoSalazar
! Around 262000 requests for 1 USD
• Request / function = 0.000000313 USD + 0.0000035 USD for the API
Gateway fees
• Around 100ms of time for every invocationAWS Lambda, and above the
minimum 128MB memory
!
@betoSalazar
The experience
Infra ready(serverless) Troubleshooting is hard
If it successful take
care about the Cost
Cold start time
I can create a set of
Microservices as
Functions
Failed fast
asalazar@advlatam.com
@betoSalazar
The Reality - Tips, tricks, pros , cons
GB Tour Latam 2019
#GroundbreakersTour
The big picture
Osgi container
engine-orchestrator.jar
Osgi container
dynamic-camel-routes.jar
fat jar
batch.jar
fat jar
services.jar
fat jar
business-module1.jar
fat jar
business-module-n.jar
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
Service
some api
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
businesslogic.jar
Rest-api-layer
fat jar
api-gateway.jar
Services
api rest
API Gateway Lambda
Lambda
@betoSalazar
Serverless Security
! A user can log in with social network credentials like Facebook, Google
! Returns JWT tokens contain the logged in user
! Use the JSON Web Tokens JWT to validate if a user makes request to a REST Endpoints
! Forget about infrastructure (that’s why we are going serverless, after all) as much as possible;
! Use Auth0 and basically forget about the security details that are behind it.
https://auth0.com
@betoSalazar
Serverless Security
https://auth0.com
@betoSalazar
Reactive systems
Project Reactor
! non-blocking applications
! 10's of millions of messages per second
! Scaling-Out to overcome latency and slow
microservices
https://projectreactor.io
https://projectreactor.io/docs/core/release/reference/
Spring Webflux
https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux
! non-blocking HTTP runtimes to the Reactive
Streams API
@betoSalazar
Reactive systems deploy on Oracle Application Container Cloud
@betoSalazar
asalazar@advlatam.com
@betoSalazar
Demo & Code blueprints:
https://github.com/lasalazarr/secure-serverless
https://www.oracle.com/technetwork/es/articles/adf/spring-webflux-p1-5131133-esa.html
https://www.oracle.com/technetwork/es/articles/adf/spring-webflux-p2-5139508-esa.html
https://github.com/lasalazarr/guide-monolithic-to-microservices
GB Tour Latam 2019
#GroundbreakersTour
asalazar@advlatam.com
@betoSalazar
Summary
GB Tour Latam 2019
#GroundbreakersTour
The conclusion
Nowadays Architecture Trends
! Not all of us needs Microservices.
! Faster to deploy new stateless business logic
with Serverless
! I can develop reactive modules (Webflux,
Reactor, R2DBC) deploy on small JVMs with no
need yet of the infrastructure to control MS
(Docker, Kubernetes, etc) 1GB Ram, 1 CPU
! Collect Distributed Logs is hard; use tools
! CLEAN CODE it is the key of your evolutionary
architecture
! Our legacy system are only legacy because
they’ve been successful enough to last this long
The conclusion
Recommendations
Hybrid approach and employing monolithic architecture styles when needed
Care about logs, monitoring and always use a CORRELATIONID and MDC (Mapped Diagnostic Context)
Experiment your architecture with small pieces of code and requirements.
Several applications with monolithic architecture is a good fit and there is no need to
change or refactor that architecture
Security - JWT json web token, Json Web Signature, Json Web Encryption
Recommendations
To manage changes review the Architectural Clash http://architecturalclash.org
-> In strategy to developed a new way to assess the level of resilience of our frontend
and mobile applications: the Architectural Clash.
Automate the deployment and delivery process -> CI & CD -> DEVOPS Culture
If you have monolith dependencies, you probably will have performance issues
The conclusion
Always think about: • Low coupling
• High Cohesion
• SOLID Principales
• CQRS Command Query Responsibility Segregation
@betoSalazar
THANK YOU
GB Tour Latam 2019
#GroundbreakersTour

More Related Content

PDF
Oracle Developer Tour Latam Nowadays Architecture Trends, from Monolith to Mi...
PDF
ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...
PDF
#JavadayEcuador Monolith to Microservices
PDF
Openstack Silicon Valley - Vendor Lock In
PDF
The FaaS and the Furious
PDF
Microxchg Microservices
PDF
Monitoring Challenges - Monitorama 2016 - Monitoringless
PPTX
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Oracle Developer Tour Latam Nowadays Architecture Trends, from Monolith to Mi...
ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...
#JavadayEcuador Monolith to Microservices
Openstack Silicon Valley - Vendor Lock In
The FaaS and the Furious
Microxchg Microservices
Monitoring Challenges - Monitorama 2016 - Monitoringless
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)

Similar to Groundbreakers tour Nowadays Architecture Trends, from Monolith to Microservices and Serverless (20)

PDF
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
PDF
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
PDF
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
PDF
Jbcnconf Nowadays Architecture Trends, from Monolith to Microservices and Ser...
PDF
Oracle Code Javaday Sao Paulo Monolith_to Microservices
PDF
Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...
PDF
Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...
PDF
Oracle Code One San Francisco - Monolith to microservices
PDF
Voxxed days cluj-napoca Nowadays architecture trends alberto_salazarv2
PDF
Rocking the microservice world with Helidon-LAOUCTour2023.pdf
PDF
Stay productive while slicing up the monolith
PDF
Stay productive while slicing up the monolith
PDF
Js foo - Sept 8 upload
PDF
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
PDF
Sail In The Cloud
PDF
[db tech showcase Tokyo 2018] #dbts2018 #B33 『DBA 18.0 - Life after 18c』
PDF
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
PDF
Istio (service mesh) why and how
PDF
Software Architecture Conference - Monitoring Microservices - A Challenge
PPTX
agile microservices @scaibo
Oracle Code Javaday Sao Paulo Nowadays Architecture Trends, from Monolith to ...
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
Jbcnconf Nowadays Architecture Trends, from Monolith to Microservices and Ser...
Oracle Code Javaday Sao Paulo Monolith_to Microservices
Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...
Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...
Oracle Code One San Francisco - Monolith to microservices
Voxxed days cluj-napoca Nowadays architecture trends alberto_salazarv2
Rocking the microservice world with Helidon-LAOUCTour2023.pdf
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
Js foo - Sept 8 upload
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
Sail In The Cloud
[db tech showcase Tokyo 2018] #dbts2018 #B33 『DBA 18.0 - Life after 18c』
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Istio (service mesh) why and how
Software Architecture Conference - Monitoring Microservices - A Challenge
agile microservices @scaibo
Ad

Recently uploaded (20)

PDF
Digital Strategies for Manufacturing Companies
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
top salesforce developer skills in 2025.pdf
PPTX
history of c programming in notes for students .pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
medical staffing services at VALiNTRY
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ai tools demonstartion for schools and inter college
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Digital Strategies for Manufacturing Companies
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
top salesforce developer skills in 2025.pdf
history of c programming in notes for students .pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PTS Company Brochure 2025 (1).pdf.......
2025 Textile ERP Trends: SAP, Odoo & Oracle
Reimagine Home Health with the Power of Agentic AI​
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
medical staffing services at VALiNTRY
How to Migrate SBCGlobal Email to Yahoo Easily
How Creative Agencies Leverage Project Management Software.pdf
Operating system designcfffgfgggggggvggggggggg
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ai tools demonstartion for schools and inter college
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Ad

Groundbreakers tour Nowadays Architecture Trends, from Monolith to Microservices and Serverless

  • 1. @betoSalazar Nowadays Architecture Trends, from Monolith to Microservices and Serverless by Alberto Salazar, Oracle Groundbreaker Ambassador Java Champion Auth0 Ambassador August 2019 GB Tour Latam 2019 #GroundbreakersTour
  • 2. Alberto Salazar @betoSalazar www.advlatam.com www.cloudbanco.com www.ecuadorjug.org www.javaday.ec ● Author ● Speaker ● Community ● Java Champion ● Groundbreaker ● Auth0 Ambassador ● Chief Advance Latam
  • 3. How I get experience? @betoSalazar
  • 4. The monolith is our legacy ?
  • 5. Source: 97 Things Every Software Architect Should Know @betoSalazar The monolith is our legacy ?
  • 6. The journey ● Overview Monolith - Microservices - Serverless ● Monolith in real life ● Microservices really? ● Third party services and Serverless ● Tips, tricks, pros, cons & code
  • 7. asalazar@advlatam.com @betoSalazar Architecture Trends Overview Monolith - Microservices - Serverless GB Tour Latam 2019 #GroundbreakersTour
  • 8. Monolith = Legacy ? @betoSalazar Application Server MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA Balancer
  • 9. Monolith = Legacy ? @betoSalazar Application Server MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA Balancer Customer Payments Loans Funds Transfer N…1 N…
  • 10. Monolith = Legacy ? @betoSalazar Application Server MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA Balancer MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA MONOLITH (EAR | WAR | JAR) Servlets EJBs JPA
  • 11. Monolith = Legacy ? @betoSalazar Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA Application Server Microservicios (EAR | WAR | JAR) Servlets EJBs JPA
  • 12. Monolith = Legacy ? Characteristics ! Attachment to the environment(language, platform & OS) ! Single logical executable, deploy everything at once or nothing at all ! Bottlenecks and Failure of part == failure of whole ! Take months even years getting into production ! Centralized authority slows the delivery process (DBA, OPS, QA) ! Coordinated releases are hard, because brings many changes together from different teams @betoSalazar
  • 13. asalazar@advlatam.com @betoSalazar The Monolith in real life GB Tour Latam 2019 #GroundbreakersTour
  • 15. What is the problem ?What is the problem ? Around 2000s
  • 16. What is the problem ?What is the problem ? @betoSalazar Grow the code and the team
  • 17. What is the problem ?What is the problem ? @betoSalazar Modular really ?
  • 18. Monolith: How it looks -> A huge EAR file @betoSalazar
  • 19. More than 10 Years of code OMG @betoSalazar
  • 20. @betoSalazar The experience Transactions Scale all or nothing Fail all or nothing Cost of maintenance Coordinate releases Trace and log Only one tech stack
  • 22. The Monolith vs Microservices How it looks http://microservices.io/patterns/monolithic.html http://microservices.io/patterns/microservices.html @betoSalazar
  • 23. Microservices Characteristics ! Deployable, executable & scaled independently ! Smaller code modules are easier to understand ! High cohesion, low coupling ! Failure is isolated (Fail one part of the system) ! Independent Teams (decide their own architecture) ! Polyglot “Plus” https://martinfowler.com/articles/microservices.html https://martinfowler.com/bliki/MicroservicePrerequisites.html @betoSalazar
  • 24. Serverless Serverless ! Developers code business logic as functions ! Forgetting everything about the servers provisioning and scaling concerns where the logic will be executed ! Ephimeral ! Multicloud, get the best from each one (AWS, Oracle Cloud, Google Cloud, AWS, Azure, etc) ! Troubleshooting is hard @betoSalazar
  • 25. Monolith vs Microservices vs Serverless Monolith Microservices Serverless
  • 27. Microservices really ? The plan of move forward (Microservices -> cloud -> serverless ?) Everybody are talking about the result (microservices architectural style) but just a few are showing the painpath @betoSalazar
  • 28. The Monolith to Microservices How it looks http://microservices.io/patterns/monolithic.html http://microservices.io/patterns/microservices.html @betoSalazar
  • 30. Move to Microservices my experience @betoSalazar !Split and establish interfaces (Test) !Reuse business logic (Test) !Move in parts the frontend (Evolve) !Rewrite or refactor the backend (Test) !Cultural evolution (CI - CD - DevOps)
  • 31. JEE application server (JBoss or WL or WAS) banking-web.ear backoffice-web.ear accounts.ear loans.ear customers.ear The Monolith to Microservices The Monolith 1 to n modules Http Web Server @betoSalazar
  • 32. JEE application server The Monolith Database JEE application server theApp.ear MODULE1.war MODULE1-JS.jar MODULE2.war MODULE3.war css.war MODULE4.war businesslogic.jar businesslogic.jar businesslogic.jar businesslogic.jar @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 33. Split the backend https://projects.spring.io/spring-boot/ https://microprofile.io/ https://vertx.io/ https://www.docker.com/ https://github.com/fabric8io/docker-maven-plugin https://github.com/spotify/docker-maven-plugin Spring boot install just what you need in a Docker Container Osgi container engine-orchestrator.jar Osgi container dynamic-camel-routes.jar fat jar batch.jar fat jar services.jar fat jar business-module1.jar fat jar business-module-n.jar Service some api Service some api Service some api Service some api Service some api Service some api businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar @betoSalazar The Monolith to Microservices
  • 34. Logging, trace & Monitoring http://www.baeldung.com/mdc-in-log4j-2-logback https://www.elastic.co/products/elasticsearch https://www.elastic.co/products/logstash https://www.elastic.co/products/kibana logstash 1) Use Mapped Diagnostic Context (MDC) Enrich log files 2) Introduce a correlationId 3) Collect the logs 4) Search by rest API or use Kibana Osgi container engine-orchestrator.jar Osgi container dynamic-camel-routes.jar fat jar batch.jar fat jar services.jar fat jar business-module1.jar fat jar business-module-n.jar Service some api Service some api Service some api Service some api Service some api Service some api businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar businesslogic.jar consumer.jar Monolith to Microservices -> Split the frontend from the backend @betoSalazar
  • 36. Microservices or Modules or Microliths We already split our monolith or we are on it https://jwt.io/ https://nodejs.org/es/ https://facebook.github.io/react/ https://angular.io/ https://facebook.github.io/react-native/ fat jar api-gateway.jar Services api rest POST bank.com/api/v1/accouts POST bank.com/api/v1/accouts logstash Login Angular nodejs Transaction Angular nodejs Module n Angular nodejs Osgi container engine-orchestrator.jar Osgi container dynamic-camel-routes.jar fat jar batch.jar fat jar services.jar fat jar business-module1.jar fat jar business-module-n.jar Service some api Service some api Service some api Service some api Service some api Service some api businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer JWT JSON WEB TOKEN & Authorization Server
  • 37. Containers - Orchestrators - Cloud Istio: Service Mesh Containers (Docker) -> Manage the same code + environment in diferente stages Orchestrators (Kubernetes, Docker Swarm, Mesos) -> We need to orchestrated our containers Cloud (eg. Oracle Cloud, Google Cloud, AWS, Azure, Bluemix) @betoSalazar
  • 38. The cost of communication over the network is not trivial. @betoSalazar The experience
  • 39. It’s hard to trace the thread of execution in a distributed system. @betoSalazar The experience
  • 41. The experience The cost of development goes up. @betoSalazar
  • 42. The experience Do you depend on a Monolith ? Provably we will have Bottlenecks @betoSalazar
  • 43. Do you have an automation pipeline process ? DELIVERY PIPELINE CI / CD CODE BUILD TEST DEPLOY CODE ANALYZE (Quality and security) If your answer is not, do it before microservices @betoSalazar
  • 44. @betoSalazar The experience 2 phase commitScaling Fail in parts More tech stack Trace and logging Polyglot Easy to understand Lose Single data repo
  • 45. asalazar@advlatam.com @betoSalazar Serverless FaaS, Backend as Services Third party services GB Tour Latam 2019 #GroundbreakersTour
  • 46. Serverless Serverless ! Developers code business logic as functions ! Forgetting everything about the servers provisioning and scaling concerns where the logic will be executed ! Ephimeral ! Multicloud, get the best from each one (AWS, Oracle Cloud, Google Cloud, AWS, Azure, etc) ! Troubleshooting is hard @betoSalazar
  • 47. https://cloud.spring.io/spring-cloud-function/ Spring Cloud Functions FaaS ! Promote the implementation of business logic via functions ! Adapters for • AWS Lambda, • Microsoft Azure, • Apache OpenWhisk • and possibly other "serverless" service providers. @betoSalazar
  • 48. The cost consideration @betoSalazar ! Around 262000 requests for 1 USD • Request / function = 0.000000313 USD + 0.0000035 USD for the API Gateway fees • Around 100ms of time for every invocationAWS Lambda, and above the minimum 128MB memory !
  • 49. @betoSalazar The experience Infra ready(serverless) Troubleshooting is hard If it successful take care about the Cost Cold start time I can create a set of Microservices as Functions Failed fast
  • 50. asalazar@advlatam.com @betoSalazar The Reality - Tips, tricks, pros , cons GB Tour Latam 2019 #GroundbreakersTour
  • 51. The big picture Osgi container engine-orchestrator.jar Osgi container dynamic-camel-routes.jar fat jar batch.jar fat jar services.jar fat jar business-module1.jar fat jar business-module-n.jar Service some api Service some api Service some api Service some api Service some api Service some api businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer businesslogic.jar Rest-api-layer fat jar api-gateway.jar Services api rest API Gateway Lambda Lambda @betoSalazar
  • 52. Serverless Security ! A user can log in with social network credentials like Facebook, Google ! Returns JWT tokens contain the logged in user ! Use the JSON Web Tokens JWT to validate if a user makes request to a REST Endpoints ! Forget about infrastructure (that’s why we are going serverless, after all) as much as possible; ! Use Auth0 and basically forget about the security details that are behind it. https://auth0.com @betoSalazar
  • 54. Reactive systems Project Reactor ! non-blocking applications ! 10's of millions of messages per second ! Scaling-Out to overcome latency and slow microservices https://projectreactor.io https://projectreactor.io/docs/core/release/reference/ Spring Webflux https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux ! non-blocking HTTP runtimes to the Reactive Streams API @betoSalazar
  • 55. Reactive systems deploy on Oracle Application Container Cloud @betoSalazar
  • 56. asalazar@advlatam.com @betoSalazar Demo & Code blueprints: https://github.com/lasalazarr/secure-serverless https://www.oracle.com/technetwork/es/articles/adf/spring-webflux-p1-5131133-esa.html https://www.oracle.com/technetwork/es/articles/adf/spring-webflux-p2-5139508-esa.html https://github.com/lasalazarr/guide-monolithic-to-microservices GB Tour Latam 2019 #GroundbreakersTour
  • 58. The conclusion Nowadays Architecture Trends ! Not all of us needs Microservices. ! Faster to deploy new stateless business logic with Serverless ! I can develop reactive modules (Webflux, Reactor, R2DBC) deploy on small JVMs with no need yet of the infrastructure to control MS (Docker, Kubernetes, etc) 1GB Ram, 1 CPU ! Collect Distributed Logs is hard; use tools ! CLEAN CODE it is the key of your evolutionary architecture ! Our legacy system are only legacy because they’ve been successful enough to last this long
  • 59. The conclusion Recommendations Hybrid approach and employing monolithic architecture styles when needed Care about logs, monitoring and always use a CORRELATIONID and MDC (Mapped Diagnostic Context) Experiment your architecture with small pieces of code and requirements. Several applications with monolithic architecture is a good fit and there is no need to change or refactor that architecture Security - JWT json web token, Json Web Signature, Json Web Encryption
  • 60. Recommendations To manage changes review the Architectural Clash http://architecturalclash.org -> In strategy to developed a new way to assess the level of resilience of our frontend and mobile applications: the Architectural Clash. Automate the deployment and delivery process -> CI & CD -> DEVOPS Culture If you have monolith dependencies, you probably will have performance issues The conclusion Always think about: • Low coupling • High Cohesion • SOLID Principales • CQRS Command Query Responsibility Segregation
  • 61. @betoSalazar THANK YOU GB Tour Latam 2019 #GroundbreakersTour