SlideShare a Scribd company logo
1 of 35
BUILDING MICROSERVICES
WITH VERT.X 3.0
AGRAJ MANGAL
AGENDA
• Microservices
• Why, why not ?
• Comparison with Monolithic Architecture
• Vert.x
• Concepts: Event Loop, Verticles, Event Bus
• Modules: core, web
• Comparisons
• Real-life Example - Pulse
MONOLITHIC ARCHITECTURE
• Logically Different Modules
• But Packaged & deployed as a Single Unit
• Initial Phases of Project
• Simple to Deploy
• Vertical Scaling
• Later on
• Difficult to Manage & Scale
• Longer Startup Times
• Slow down Development
• CI becomes challenging
MICROSERVICES PATTERN
• Split into Smaller, Interconnected Services
• Loose Coupling
• Service == Functional Area
• Service exposes APIs – consumed by other services & clients
FINE GRAINED VIEW
BENEFITS
• Enforces Modularity
• Decomposing complexity
• Manageable chunks
• Each service – well defined boundary
• Independent Development
• Different Teams
• Different Technologies
• Easy to test
• Scaling is Easy
• Each service can be scaled independently
• Different Service might have different requirements ( CPU, Memory )
SCALING
MICROSERVICES
SERVICES
COMMUNICATING
DRAWBACKS
• Partitioned Database Architecture
• Have to settle for Eventual Consistency
• ACID transactions not possible
• Deploying
• Though scalable, but more complex
• Many more moving parts
• Service Discovery required
• Polyglot (Java, JavaScript, Groovy, Ruby, Python etc.)
• Event-driven & Non-blocking programming model
• Super simple Concurrency Model
• Lightweight ~ 650Kb
• “Ideal choice for creating light-weight, high-
performance, microservices”
• Public module repository
• Reactive applications
• Asynchronous APIs
CONCEPTS
• Event Loop
• Verticles
• Server Verticles
• Worker Verticles
• Event Bus
• Point to Point
• Pub/Sub
• Distributed
THE FAMOUS EVENT LOOP
ARCHITECTURE
• Don’t Block the Event Loop
• Workers “can” block
• Message Passing using Event Bus
• Concurrency Model
• A Verticle instance is always Single threaded
• No more Locking, synchronized & race conditions
• Actor-like concurrency model
• Scaling
• By Creating more Verticle Instances
• For TCP & HTTP servers, Vert.x does automatic load balancing
• Use FAT Jar for Deployment
VERT.X MODULES
• Core
• Web
• Data Access
• MongoDB, JDBC, Redis, MySQL
• Authentication Modules
• JWT, OAuth 2, JDBC Auth, Shiro Auth, MongoDB auth
• Messaging Systems
• Kafka, RabbitMQ
• Clustering – Hazelcast
VERT.X CORE
• Servers & clients
• TCP/SSL
• HTTP/HTTPS
• Websocket & SockJS
• EventBus
• Shared Maps & Sets
• Buffers & Flow Control
• Container API – Deploy & Undeploy Verticles
• Timers & Files
• Logging
• Configuration
VERT.X HTTP SERVER – HELLO WORLD
VERT.X WEB
• Routing
• Regex Matching
• Request Body Handling, parameters extraction
• Cookie Parsing & Handling
• Multipart Form & File Upload
• Session support ( sticky & non-sticky )
• CORS & CSRF Support
• Authentication & Authorization
• SockJS Support
VERT.X WEB HELLO WORLD
ROUTING
ROUTING
• Chain of Routers
• Either “end” it
• Or pass it to the “next” one
• Various Options – Route by
• HTTP Method Type
• Exact Path
• Regex Matching
• MIME type of request
• Decide Routing Order
VERT.X WEB
• BodyHandler
• Retrieve Request Body
• Limit Body Size
• Handle File Uploads
• CookieHandler
• Get, Add, Delete Cookie
• SessionHandler
• Sticky & Non-Sticky Sessions
• Vert.x don’t put actual data in Session Cookie – Session UUID is used to
lookup data on the server
• Session timeouts
VERT.X WEB
• Authentication & Authorization
• Support for Basic-Auth, Redirect-Auth, FormLogin
• JWT
• OAuth2
• Static Resources
• StaticHandler
• Caching – set headers ( cache-control, last-modified, date )
• Configurable webroot, index page
• Disable File Caching - .vertx
• Templating Support
• Handlebars, Jade, MVEL, Thymeleaf
• CORS & CSFR Handlers
DISTRIBUTED SUPPORT
DISTRIBUTED EVENT BUS
• Connect multiple Vert.x
instances across JVMs
• Event bus extends to client side
Javascript
• Ideal for “real-time” web
applications
• vertx-eventbus.js
CLUSTERING
• Hazelcast
• Shared Data Structures
REALTIME COMMUNICATION - SOCKJS
• Excellent Support for Low-latency, full-duplex cross-communication
channel
• Tries
• Native Websocket
• Browser specific transport protocols
• Polling for old browsers
• Heartbeats – prevent load balancers & proxies to close long running
http requests
• Vert.x – built in support for SockJS
• SockJS event bus bridge
• Distributed event bus
• Extend’s vert.x server side event bus to JavaScript clients
• vertx-eventbus.js – publish & register messages
APPLICATION PACKAGING
• Maven & Gradle Tooling Support
• Packaging
• Use maven-shade-plugin to package as FAT Jar
• Run the Jar
MESSAGE TYPES – EVENT BUS
• Primitives & their Boxed Types
• String
• org.vertx.java.core.json.JsonObject
• org.vertx.java.core.json.JsonArray
• org.vertx.java.core.buffer.Buffer
• Custom Type Support – Write your own Serializer
REAL-LIFE EXAMPLE - PULSE
• Marketing Cloud Core Service
• REST API for Notifications
• Vertx-Web powered Microservice
COMPARISONS
• Vert.x Vs Netty
• Application Vs Infrastructure
• Vert.x provides higher level IO
• Vert.x Vs Jetty
• Vert.x Vs NodeJS
• Use all available cores
VERT.X VS NODEJS
NodeJS vs Vert.x Performance
RESOURCES
• Nginx Microservices Introduction
• NodeJS Event Loop
• Interview with Tim Fox on Vert.x 3
• SockJS

More Related Content

What's hot

Service Discovery: From Classic to VPC
Service Discovery: From Classic to VPCService Discovery: From Classic to VPC
Service Discovery: From Classic to VPCMark Corwin
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with DockerKhôi Nguyễn Minh
 
Building microservices web application using scala & akka
Building microservices web application using scala & akkaBuilding microservices web application using scala & akka
Building microservices web application using scala & akkaBinh Nguyen
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Christian Posta
 
Hypervisor Selection in CloudStack and OpenStack
Hypervisor Selection in CloudStack and OpenStackHypervisor Selection in CloudStack and OpenStack
Hypervisor Selection in CloudStack and OpenStackTim Mackey
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacksAlkin Tezuysal
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overviewrajdeep
 
CloudStack vs OpenStack
CloudStack vs OpenStackCloudStack vs OpenStack
CloudStack vs OpenStackVictor Zhang
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencyThomas Jackson
 
GUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaGUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaRodrigo Cândido da Silva
 
Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)Designveloper
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners openstackindia
 
Lightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESBLightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESBWSO2
 

What's hot (20)

Service Discovery: From Classic to VPC
Service Discovery: From Classic to VPCService Discovery: From Classic to VPC
Service Discovery: From Classic to VPC
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with Docker
 
WSO2 Gateway
WSO2 GatewayWSO2 Gateway
WSO2 Gateway
 
OpenNebula Administrator View
OpenNebula Administrator ViewOpenNebula Administrator View
OpenNebula Administrator View
 
Building microservices web application using scala & akka
Building microservices web application using scala & akkaBuilding microservices web application using scala & akka
Building microservices web application using scala & akka
 
Vertx
VertxVertx
Vertx
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes
 
Hypervisor Selection in CloudStack and OpenStack
Hypervisor Selection in CloudStack and OpenStackHypervisor Selection in CloudStack and OpenStack
Hypervisor Selection in CloudStack and OpenStack
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacks
 
What's New in WildFly 9?
What's New in WildFly 9?What's New in WildFly 9?
What's New in WildFly 9?
 
ONE Tips & Tricks
ONE Tips & Tricks ONE Tips & Tricks
ONE Tips & Tricks
 
VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overview
 
CloudStack vs OpenStack
CloudStack vs OpenStackCloudStack vs OpenStack
CloudStack vs OpenStack
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrency
 
GUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaGUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com Java
 
Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners
 
Alex Fishman - Virtualizing the Cloud
Alex Fishman - Virtualizing the CloudAlex Fishman - Virtualizing the Cloud
Alex Fishman - Virtualizing the Cloud
 
Lightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESBLightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESB
 
Multi tenancy for docker
Multi tenancy for dockerMulti tenancy for docker
Multi tenancy for docker
 

Viewers also liked

Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Red Hat Developers
 
Vert.x clustering on Docker, CoreOS and ETCD
Vert.x clustering on Docker, CoreOS and ETCDVert.x clustering on Docker, CoreOS and ETCD
Vert.x clustering on Docker, CoreOS and ETCDTim Nolet
 
Modern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xModern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xThomas Segismont
 
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...Codemotion
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
Reactive Polyglot Microservices with OpenShift and Vert.x
Reactive Polyglot Microservices with OpenShift and Vert.xReactive Polyglot Microservices with OpenShift and Vert.x
Reactive Polyglot Microservices with OpenShift and Vert.xReactivesummit
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in JavaClément Escoffier
 
Refactoring for microservices
Refactoring for microservicesRefactoring for microservices
Refactoring for microservicesIsmael Rivera
 
vert.x - life beyond jetty and apache
vert.x - life beyond jetty and apachevert.x - life beyond jetty and apache
vert.x - life beyond jetty and apacheRalph Winzinger
 
Microservices designing deploying
Microservices designing deployingMicroservices designing deploying
Microservices designing deployingSuresh Kumar
 
Mangal das garças
Mangal das garçasMangal das garças
Mangal das garçasRosa Silva
 
O mangal fica muito batido visão da utilização do manguezal pelo pescador e...
O mangal fica muito batido   visão da utilização do manguezal pelo pescador e...O mangal fica muito batido   visão da utilização do manguezal pelo pescador e...
O mangal fica muito batido visão da utilização do manguezal pelo pescador e...Daniel S Fernandes
 
Aseptoray technology presentation MDB
Aseptoray technology presentation MDBAseptoray technology presentation MDB
Aseptoray technology presentation MDBMangal Dev Bariwal
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xSascha Möllering
 
Case study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless WorldCase study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless WorldDay Software
 
Event driven microservices with vertx and kubernetes
Event driven microservices with vertx and kubernetesEvent driven microservices with vertx and kubernetes
Event driven microservices with vertx and kubernetesAndy Moncsek
 

Viewers also liked (20)

Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
 
Vert.x clustering on Docker, CoreOS and ETCD
Vert.x clustering on Docker, CoreOS and ETCDVert.x clustering on Docker, CoreOS and ETCD
Vert.x clustering on Docker, CoreOS and ETCD
 
Vert.x
Vert.xVert.x
Vert.x
 
Modern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xModern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.x
 
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...
Building microservices with Vert.x - Bert Jan Schrijver - Codemotion Amsterda...
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Reactive Polyglot Microservices with OpenShift and Vert.x
Reactive Polyglot Microservices with OpenShift and Vert.xReactive Polyglot Microservices with OpenShift and Vert.x
Reactive Polyglot Microservices with OpenShift and Vert.x
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Java
 
Refactoring for microservices
Refactoring for microservicesRefactoring for microservices
Refactoring for microservices
 
How do event loops work in Python?
How do event loops work in Python?How do event loops work in Python?
How do event loops work in Python?
 
vert.x - life beyond jetty and apache
vert.x - life beyond jetty and apachevert.x - life beyond jetty and apache
vert.x - life beyond jetty and apache
 
Microservices designing deploying
Microservices designing deployingMicroservices designing deploying
Microservices designing deploying
 
Mangal das garças
Mangal das garçasMangal das garças
Mangal das garças
 
O mangal fica muito batido visão da utilização do manguezal pelo pescador e...
O mangal fica muito batido   visão da utilização do manguezal pelo pescador e...O mangal fica muito batido   visão da utilização do manguezal pelo pescador e...
O mangal fica muito batido visão da utilização do manguezal pelo pescador e...
 
Aseptoray technology presentation MDB
Aseptoray technology presentation MDBAseptoray technology presentation MDB
Aseptoray technology presentation MDB
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Dwdm
DwdmDwdm
Dwdm
 
Vert.x
Vert.xVert.x
Vert.x
 
Case study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless WorldCase study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless World
 
Event driven microservices with vertx and kubernetes
Event driven microservices with vertx and kubernetesEvent driven microservices with vertx and kubernetes
Event driven microservices with vertx and kubernetes
 

Similar to Building microservices with vert.x 3.0

How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?Dmitry Buzdin
 
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?PROIDEA
 
Flying to clouds - can it be easy? Cloud Native Applications
Flying to clouds - can it be easy? Cloud Native ApplicationsFlying to clouds - can it be easy? Cloud Native Applications
Flying to clouds - can it be easy? Cloud Native ApplicationsJacek Bukowski
 
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Christian Posta
 
Amazon AWS vs Azure Cloud vs Kubernetes
Amazon AWS vs Azure Cloud vs KubernetesAmazon AWS vs Azure Cloud vs Kubernetes
Amazon AWS vs Azure Cloud vs KubernetesStridely Solutions
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012Alexandre Morgaut
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-servicesChristian Posta
 
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to KubernetesMigrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to KubernetesTony Erwin
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows AzureRadu Vunvulea
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webC2B2 Consulting
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresMichel Schildmeijer
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stackNitin Mehta
 
Getting Started with Apache CloudStack
Getting Started with Apache CloudStackGetting Started with Apache CloudStack
Getting Started with Apache CloudStackJoe Brockmeier
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeAlex Thissen
 
Transforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesTransforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesAdam Takvam
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012CMC Limited
 

Similar to Building microservices with vert.x 3.0 (20)

How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
Microservices in Azure
Microservices in AzureMicroservices in Azure
Microservices in Azure
 
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
 
Flying to clouds - can it be easy? Cloud Native Applications
Flying to clouds - can it be easy? Cloud Native ApplicationsFlying to clouds - can it be easy? Cloud Native Applications
Flying to clouds - can it be easy? Cloud Native Applications
 
Microservices in Azure
Microservices in AzureMicroservices in Azure
Microservices in Azure
 
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
 
Amazon AWS vs Azure Cloud vs Kubernetes
Amazon AWS vs Azure Cloud vs KubernetesAmazon AWS vs Azure Cloud vs Kubernetes
Amazon AWS vs Azure Cloud vs Kubernetes
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
 
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to KubernetesMigrating Enterprise Microservices From Cloud Foundry to Kubernetes
Migrating Enterprise Microservices From Cloud Foundry to Kubernetes
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy features
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stack
 
Getting Started with Apache CloudStack
Getting Started with Apache CloudStackGetting Started with Apache CloudStack
Getting Started with Apache CloudStack
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
 
Transforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesTransforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web Services
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Building microservices with vert.x 3.0

  • 2. AGENDA • Microservices • Why, why not ? • Comparison with Monolithic Architecture • Vert.x • Concepts: Event Loop, Verticles, Event Bus • Modules: core, web • Comparisons • Real-life Example - Pulse
  • 3. MONOLITHIC ARCHITECTURE • Logically Different Modules • But Packaged & deployed as a Single Unit • Initial Phases of Project • Simple to Deploy • Vertical Scaling • Later on • Difficult to Manage & Scale • Longer Startup Times • Slow down Development • CI becomes challenging
  • 4.
  • 5. MICROSERVICES PATTERN • Split into Smaller, Interconnected Services • Loose Coupling • Service == Functional Area • Service exposes APIs – consumed by other services & clients
  • 6.
  • 8. BENEFITS • Enforces Modularity • Decomposing complexity • Manageable chunks • Each service – well defined boundary • Independent Development • Different Teams • Different Technologies • Easy to test • Scaling is Easy • Each service can be scaled independently • Different Service might have different requirements ( CPU, Memory )
  • 11. DRAWBACKS • Partitioned Database Architecture • Have to settle for Eventual Consistency • ACID transactions not possible • Deploying • Though scalable, but more complex • Many more moving parts • Service Discovery required
  • 12. • Polyglot (Java, JavaScript, Groovy, Ruby, Python etc.) • Event-driven & Non-blocking programming model • Super simple Concurrency Model • Lightweight ~ 650Kb • “Ideal choice for creating light-weight, high- performance, microservices” • Public module repository • Reactive applications • Asynchronous APIs
  • 13. CONCEPTS • Event Loop • Verticles • Server Verticles • Worker Verticles • Event Bus • Point to Point • Pub/Sub • Distributed
  • 16. • Don’t Block the Event Loop • Workers “can” block • Message Passing using Event Bus • Concurrency Model • A Verticle instance is always Single threaded • No more Locking, synchronized & race conditions • Actor-like concurrency model • Scaling • By Creating more Verticle Instances • For TCP & HTTP servers, Vert.x does automatic load balancing • Use FAT Jar for Deployment
  • 17. VERT.X MODULES • Core • Web • Data Access • MongoDB, JDBC, Redis, MySQL • Authentication Modules • JWT, OAuth 2, JDBC Auth, Shiro Auth, MongoDB auth • Messaging Systems • Kafka, RabbitMQ • Clustering – Hazelcast
  • 18. VERT.X CORE • Servers & clients • TCP/SSL • HTTP/HTTPS • Websocket & SockJS • EventBus • Shared Maps & Sets • Buffers & Flow Control • Container API – Deploy & Undeploy Verticles • Timers & Files • Logging • Configuration
  • 19. VERT.X HTTP SERVER – HELLO WORLD
  • 20. VERT.X WEB • Routing • Regex Matching • Request Body Handling, parameters extraction • Cookie Parsing & Handling • Multipart Form & File Upload • Session support ( sticky & non-sticky ) • CORS & CSRF Support • Authentication & Authorization • SockJS Support
  • 23. ROUTING • Chain of Routers • Either “end” it • Or pass it to the “next” one • Various Options – Route by • HTTP Method Type • Exact Path • Regex Matching • MIME type of request • Decide Routing Order
  • 24. VERT.X WEB • BodyHandler • Retrieve Request Body • Limit Body Size • Handle File Uploads • CookieHandler • Get, Add, Delete Cookie • SessionHandler • Sticky & Non-Sticky Sessions • Vert.x don’t put actual data in Session Cookie – Session UUID is used to lookup data on the server • Session timeouts
  • 25. VERT.X WEB • Authentication & Authorization • Support for Basic-Auth, Redirect-Auth, FormLogin • JWT • OAuth2 • Static Resources • StaticHandler • Caching – set headers ( cache-control, last-modified, date ) • Configurable webroot, index page • Disable File Caching - .vertx • Templating Support • Handlebars, Jade, MVEL, Thymeleaf • CORS & CSFR Handlers
  • 26. DISTRIBUTED SUPPORT DISTRIBUTED EVENT BUS • Connect multiple Vert.x instances across JVMs • Event bus extends to client side Javascript • Ideal for “real-time” web applications • vertx-eventbus.js CLUSTERING • Hazelcast • Shared Data Structures
  • 27. REALTIME COMMUNICATION - SOCKJS • Excellent Support for Low-latency, full-duplex cross-communication channel • Tries • Native Websocket • Browser specific transport protocols • Polling for old browsers • Heartbeats – prevent load balancers & proxies to close long running http requests • Vert.x – built in support for SockJS • SockJS event bus bridge • Distributed event bus • Extend’s vert.x server side event bus to JavaScript clients • vertx-eventbus.js – publish & register messages
  • 28. APPLICATION PACKAGING • Maven & Gradle Tooling Support • Packaging • Use maven-shade-plugin to package as FAT Jar • Run the Jar
  • 29.
  • 30. MESSAGE TYPES – EVENT BUS • Primitives & their Boxed Types • String • org.vertx.java.core.json.JsonObject • org.vertx.java.core.json.JsonArray • org.vertx.java.core.buffer.Buffer • Custom Type Support – Write your own Serializer
  • 31. REAL-LIFE EXAMPLE - PULSE • Marketing Cloud Core Service • REST API for Notifications • Vertx-Web powered Microservice
  • 32.
  • 33. COMPARISONS • Vert.x Vs Netty • Application Vs Infrastructure • Vert.x provides higher level IO • Vert.x Vs Jetty • Vert.x Vs NodeJS • Use all available cores
  • 34. VERT.X VS NODEJS NodeJS vs Vert.x Performance
  • 35. RESOURCES • Nginx Microservices Introduction • NodeJS Event Loop • Interview with Tim Fox on Vert.x 3 • SockJS