SlideShare una empresa de Scribd logo
1 de 70
asalazar@advlatam.com
@betoSalazar
Nowadays Architecture Trends,
from Monolith to Microservices and Serverless
Alberto Salazar,
CTO Advance Latam,
Java Champion
Auth0 Ambassador
Oracle Groundbreaker Ambassador
8th March 2019
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
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
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
! Vendor lock-in is a myth
! 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
The Monolith in real life
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
asalazar@advlatam.com
@betoSalazar
Microservices really ?
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
Microservices our 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)
thebanking.ear
banking-web.war
banking-js.jar
backoffice-web.war
accounts.jar
loans.jar
customers.jar
The Monolith to Microservices
The Monolith
1 to n modules
1 to n modules
Http
Web
Server
@betoSalazar
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 frontend from the backend
JSF Controller Code
Call the Facade
The path -> Split the frontend from the backend
@betoSalazar
Split the frontend from the backend
Facade Code
Call the Business
Logic
@betoSalazar
The Monolith to MicroservicesThe Monolith to Microservices
The communication
JEE application server
theApp-backend.ear
businesslogi
businesslogi
businesslogibusinesslogic.jar
JEE application server
theApp.ear
MODULE1.war
MODULE1-JS.jar
MODULE2.war
MODULE3.war
css.war
MODULE4.war
Database
Message
Queue
Apache ActiveMQ
RabbitMQ
Apache Kafka……
http://activemq.apache.org
https://www.rabbitmq.com
https://kafka.apache.org
producer.jar
http://camel.apache.org/mdc-logging.html
http://camel.apache.org/eip.html
consumer.jar
@betoSalazar
The Monolith to MicroservicesThe Monolith to Microservices
Split the frontend from the backend
Call the Processor
@betoSalazar
The Monolith to MicroservicesThe Monolith to Microservices
Split the frontend from the backend
Camel Processor Code
Call the Facade
@betoSalazar
The Monolith to MicroservicesThe Monolith to Microservices
JEE application server
theApp.ear
MODULE1.war
MODULE1-JS.jar
MODULE2.war
MODULE3.war
css.war
MODULE4.war
Database
Message
Queue
producer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
Split the backend
@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
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp.ear
MODULE1.war
MODULE1-JS.jar
MODULE2.war
MODULE3.war
css.war
MODULE4.war
Database
Message
Queue
producer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jar
JEE application server
theApp-backend.ear
businesslogic.jar
consumer.jarRest API
rest-client.jar
Rest-api-layer
Rest-api-layer
Rest-api-layer
Rest-api-layer
Rest-api-layer
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
Lose TransactionsScaling
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
Serverless
Serverless
! Developers code business logic as functions
! Forgetting everything about the servers
provisioning and scaling concerns where the
logic will be executed
! Ephimeral
! Vendor lock-in is a myth
! 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
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
@betoSalazar
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://github.com/lasalazarr/guide-monolithic-to-microservices
asalazar@advlatam.com
@betoSalazar
Summary
The conclusion
Nowadays Architecture Trends
! Nowadays we are dealing with a Distributed
Complex Architecture
! Secure your endpoints is a rule
! The system and services have to deal with:
• network communications,
• failures,
• rebalances,
• splits and refactor
! Our legacy system are only legacy because
they’ve been successful enough to last this long
The conclusion
Recommendations
If you can fit your team around a table you maybe don’t need microservices
yet
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
Design for failover, Service load balancing and automatic scaling, data Separation,
Integrity, Performance
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
asalazar@advlatam.com
@betoSalazar
THANK YOU
Auth0 Ambassadors.
Helping the developer community make the internet
safer.

Más contenido relacionado

Similar a Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and Serverless

Similar a Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and Serverless (20)

2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia 2018 MONOLITICH TO MICROSERVICES  - Conferencia Javeros colombia
2018 MONOLITICH TO MICROSERVICES - Conferencia Javeros colombia
 
Oracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to MicroservicesOracle Code Javaday Sao Paulo Monolith_to Microservices
Oracle Code Javaday Sao Paulo Monolith_to Microservices
 
Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...
Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...
Oracle code bogota-Handle the Complexity of Migrate to Microservices from Mon...
 
#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to Microservices#JavadayEcuador Monolith to Microservices
#JavadayEcuador Monolith to Microservices
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Changing application demands: What developers need to know
Changing application demands: What developers need to knowChanging application demands: What developers need to know
Changing application demands: What developers need to know
 
"KillTech project: through innovation to a winning capability", Yelyzaveta B...
"KillTech project: through innovation to a winning capability",  Yelyzaveta B..."KillTech project: through innovation to a winning capability",  Yelyzaveta B...
"KillTech project: through innovation to a winning capability", Yelyzaveta B...
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...
 
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
 
Cloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyondCloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyond
 
FEVR - Micro Frontend
FEVR - Micro FrontendFEVR - Micro Frontend
FEVR - Micro Frontend
 
Migrating Monoliths to Microservices -- M3
Migrating Monoliths to Microservices -- M3Migrating Monoliths to Microservices -- M3
Migrating Monoliths to Microservices -- M3
 
How to migrate large project from Angular to React
How to migrate large project from Angular to ReactHow to migrate large project from Angular to React
How to migrate large project from Angular to React
 
IoT and Maker Crossover (IMCO) Conference 2015
IoT and Maker Crossover (IMCO) Conference 2015IoT and Maker Crossover (IMCO) Conference 2015
IoT and Maker Crossover (IMCO) Conference 2015
 
Microservices Patterns with GoldenGate
Microservices Patterns with GoldenGateMicroservices Patterns with GoldenGate
Microservices Patterns with GoldenGate
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration Patterns
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 

Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and Serverless

  • 1. asalazar@advlatam.com @betoSalazar Nowadays Architecture Trends, from Monolith to Microservices and Serverless Alberto Salazar, CTO Advance Latam, Java Champion Auth0 Ambassador Oracle Groundbreaker Ambassador 8th March 2019
  • 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
  • 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. The Monolith vs Microservices How it looks http://microservices.io/patterns/monolithic.html http://microservices.io/patterns/microservices.html @betoSalazar
  • 14. 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
  • 15. Serverless Serverless ! Developers code business logic as functions ! Forgetting everything about the servers provisioning and scaling concerns where the logic will be executed ! Ephimeral ! Vendor lock-in is a myth ! Multicloud, get the best from each one (AWS, Oracle Cloud, Google Cloud, AWS, Azure, etc) ! Troubleshooting is hard @betoSalazar
  • 16. Monolith vs Microservices vs Serverless Monolith Microservices Serverless
  • 19. What is the problem ?What is the problem ? Around 2000s
  • 20. What is the problem ?What is the problem ? @betoSalazar Grow the code and the team
  • 21. What is the problem ?What is the problem ? @betoSalazar Modular really ?
  • 22. Monolith: How it looks -> A huge EAR file @betoSalazar
  • 23. More than 10 Years of code OMG @betoSalazar
  • 24. @betoSalazar The experience Transactions Scale all or nothing Fail all or nothing Cost of maintenance Coordinate releases Trace and log Only one tech stack
  • 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. Microservices our 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) thebanking.ear banking-web.war banking-js.jar backoffice-web.war accounts.jar loans.jar customers.jar The Monolith to Microservices The Monolith 1 to n modules 1 to n modules Http Web Server @betoSalazar
  • 32. 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
  • 33. 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
  • 34. Split the frontend from the backend JSF Controller Code Call the Facade The path -> Split the frontend from the backend @betoSalazar
  • 35. Split the frontend from the backend Facade Code Call the Business Logic @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 36. The communication JEE application server theApp-backend.ear businesslogi businesslogi businesslogibusinesslogic.jar JEE application server theApp.ear MODULE1.war MODULE1-JS.jar MODULE2.war MODULE3.war css.war MODULE4.war Database Message Queue Apache ActiveMQ RabbitMQ Apache Kafka…… http://activemq.apache.org https://www.rabbitmq.com https://kafka.apache.org producer.jar http://camel.apache.org/mdc-logging.html http://camel.apache.org/eip.html consumer.jar @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 37. Split the frontend from the backend Call the Processor @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 38. Split the frontend from the backend Camel Processor Code Call the Facade @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 39. JEE application server theApp.ear MODULE1.war MODULE1-JS.jar MODULE2.war MODULE3.war css.war MODULE4.war Database Message Queue producer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar Split the backend @betoSalazar The Monolith to MicroservicesThe Monolith to Microservices
  • 40. 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
  • 41. 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
  • 42. JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp.ear MODULE1.war MODULE1-JS.jar MODULE2.war MODULE3.war css.war MODULE4.war Database Message Queue producer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jar JEE application server theApp-backend.ear businesslogic.jar consumer.jarRest API rest-client.jar Rest-api-layer Rest-api-layer Rest-api-layer Rest-api-layer Rest-api-layer Monolith to Microservices -> Split the frontend from the backend @betoSalazar
  • 44. 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
  • 45. 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
  • 46. The cost of communication over the network is not trivial. @betoSalazar The experience
  • 47. It’s hard to trace the thread of execution in a distributed system. @betoSalazar The experience
  • 49. The experience The cost of development goes up. @betoSalazar
  • 50. The experience Do you depend on a Monolith ? Provably we will have Bottlenecks @betoSalazar
  • 51. 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
  • 52. @betoSalazar The experience Lose TransactionsScaling Fail in parts More tech stack Trace and logging Polyglot Easy to understand Lose Single data repo
  • 54. Serverless Serverless ! Developers code business logic as functions ! Forgetting everything about the servers provisioning and scaling concerns where the logic will be executed ! Ephimeral ! Vendor lock-in is a myth ! Multicloud, get the best from each one (AWS, Oracle Cloud, Google Cloud, AWS, Azure, etc) ! Troubleshooting is hard @betoSalazar
  • 55. 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
  • 56. 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 !
  • 57. @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
  • 59. 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 @betoSalazar
  • 60. 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
  • 61. 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
  • 63. 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
  • 64. Reactive systems deploy on Oracle Application Container Cloud @betoSalazar
  • 67. The conclusion Nowadays Architecture Trends ! Nowadays we are dealing with a Distributed Complex Architecture ! Secure your endpoints is a rule ! The system and services have to deal with: • network communications, • failures, • rebalances, • splits and refactor ! Our legacy system are only legacy because they’ve been successful enough to last this long
  • 68. The conclusion Recommendations If you can fit your team around a table you maybe don’t need microservices yet 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
  • 69. 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 Design for failover, Service load balancing and automatic scaling, data Separation, Integrity, Performance 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
  • 70. asalazar@advlatam.com @betoSalazar THANK YOU Auth0 Ambassadors. Helping the developer community make the internet safer.