SlideShare a Scribd company logo
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
Building microservices with vert.x 3.0
MICROSERVICES PATTERN
• Split into Smaller, Interconnected Services
• Loose Coupling
• Service == Functional Area
• Service exposes APIs – consumed by other services & clients
Building microservices with vert.x 3.0
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
Building microservices with vert.x 3.0
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
Building microservices with vert.x 3.0
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 VPC
Mark Corwin
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with Docker
Khôi Nguyễn Minh
 
WSO2 Gateway
WSO2 GatewayWSO2 Gateway
WSO2 Gateway
Kasun Indrasiri
 
OpenNebula Administrator View
OpenNebula Administrator ViewOpenNebula Administrator View
OpenNebula Administrator View
OpenNebula Project
 
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
Binh Nguyen
 
Vertx
VertxVertx
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 OpenStack
Tim 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 attacks
Alkin Tezuysal
 
What's New in WildFly 9?
What's New in WildFly 9?What's New in WildFly 9?
What's New in WildFly 9?
Virtual JBoss User Group
 
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
rajdeep
 
CloudStack vs OpenStack
CloudStack vs OpenStackCloudStack vs OpenStack
CloudStack vs OpenStack
Victor 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 concurrency
Thomas 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 Java
Rodrigo 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
 
Alex Fishman - Virtualizing the Cloud
Alex Fishman - Virtualizing the CloudAlex Fishman - Virtualizing the Cloud
Alex Fishman - Virtualizing the Cloud
Cloud Native Day Tel Aviv
 
Lightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESBLightweight Orchestration with WSO2 ESB
Lightweight Orchestration with WSO2 ESB
WSO2
 
Multi tenancy for docker
Multi tenancy for dockerMulti tenancy for docker
Multi tenancy for docker
Ananth Padmanabhan
 

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 ETCD
Tim Nolet
 
Vert.x
Vert.xVert.x
Vert.x
Matt Stine
 
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
Thomas 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 Architecture
Idan 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.x
Reactivesummit
 
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
Clément Escoffier
 
Refactoring for microservices
Refactoring for microservicesRefactoring for microservices
Refactoring for microservices
Ismael Rivera
 
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?
Saúl Ibarra Corretgé
 
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
Ralph Winzinger
 
Microservices designing deploying
Microservices designing deployingMicroservices designing deploying
Microservices designing deploying
Suresh Kumar
 
Mangal das garças
Mangal das garçasMangal das garças
Mangal das garças
Rosa 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 MDB
Mangal 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.x
Sascha Möllering
 
Dwdm
DwdmDwdm
Vert.x
Vert.xVert.x
Vert.x
Xavier MARIN
 
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
Day 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 kubernetes
Andy 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
 
Microservices in Azure
Microservices in AzureMicroservices in Azure
Microservices in Azure
Doug Vanderweide
 
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
Jacek Bukowski
 
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
 
Microservices in Azure
Microservices in AzureMicroservices in Azure
Microservices in Azure
Doug Vanderweide
 
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
Christian 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 Kubernetes
Stridely 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 2012
Alexandre Morgaut
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
Christian 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 Kubernetes
Tony Erwin
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
Radu 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 presentation
Stuart (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-web
C2B2 Consulting
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy features
Michel Schildmeijer
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
Sepehr Rasouli
 
Hacking apache cloud stack
Hacking apache cloud stackHacking apache cloud stack
Hacking apache cloud stack
Nitin Mehta
 
Getting Started with Apache CloudStack
Getting Started with Apache CloudStackGetting Started with Apache CloudStack
Getting Started with Apache CloudStack
Joe Brockmeier
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
Alex 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 Services
Adam 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 2012
CMC 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
 
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
 
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?
 
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

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 

Recently uploaded (20)

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 

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
  • 5. MICROSERVICES PATTERN • Split into Smaller, Interconnected Services • Loose Coupling • Service == Functional Area • Service exposes APIs – consumed by other services & clients
  • 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
  • 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
  • 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