SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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