Be happy. Reactive applications and
Microservices with Vert.x tool-kit
Victor Hugo / Recife-PE
http://titorec.net
Reactive applications
What Reactive means ?
“Showing a response to a stimulus” Oxford
“Tending to be responsive or to react to a stimulus.” http://www.thefreedictionary.com/reactive
Response and react to a stimulus quickly
Reactive concepts
Responsive
A responsive system is quick to answer to all users in beautiful ways or bad ways
Rapid
Consistent
Resilient
A resilient system offer an architecture type where bad days become good days
A resilient system guarantees the availability of your service
Replication
Isolation
Failover
Load balance
Fail tolerance
Scalable
A scalable system is easy to increment when you need to answer several load types
Scaling up (max memory)
Scaling out (max childs on the cluster)
Event driven
A event driven system is based on events which are expected by one or more observers
A event driven system is asynchronous where messages are delivered when the process
end without block the thread where the event was fired
Microservices
Monolithic application
HTML / JAVASCRIPT
Movie Service Recommendation ServiceAnalysis ServiceRating Service User Service
Data Access
Application domain
Microservices architecture
HTML / JAVASCRIPT
Movie Service
Data Access
HTML / JAVASCRIPT
User Service
Data Access
HTML / JAVASCRIPT
Rating Service
Data Access
HTML / JAVASCRIPT
Recommendation
Service
Data Access
HTML / JAVASCRIPT
Analysis Service
Data Access
MySQL MySQL Neo4j MongoDB Spark
Application domain
Microservices communication
Microservices characteristics
• Automation
• Continuous delivery
• Decentralize the things
• Each team take control about their deploys
• Small teams (max of 4 people)
• Does not necessary stop all services to deploy a new service
• Easy scaling
• Architecture fail tolerance (One fail does not stop all application)
• Each service is elastic, resilient, composable, minimal, and complete
• The services are small and easy to manage
And now. Who will help me ?
Here is the answer. Vert.x
http://vertx.io/
General purpose
http://vertx.io/
Vert.x is incredibly flexible – whether it’s
simple network utilities, sophisticated
modern web applications, HTTP/REST
microservices, high volume event processing
or a full blown back-end message-bus
application, Vert.x is a great fit.
Vert.x is not restrictive framework or
container and we don’t tell you a correct
way to write an application. Instead we
give you a lot of useful bricks and let you
create your app the way you want to.
Scale
http://vertx.io/
Vert.x is event driven and non blocking. This
means your app can handle a lot of
concurrency using a small number of kernel
threads. Vert.x lets you app scale with
minimal hardware.
Scale
Vert.x architecture
How the Event Loop(non-blocking) works
If a thread to execute a long operation that does not use CPU like read or write data
to disk other thread can be executed until the first operation to be finished
maximizing the CPU use.
Polyglot
http://vertx.io/
You can use Vert.x with multiple
languages including Java, JavaScript,
Groovy and Ruby.
Vert.x doesn’t preach about what
language is best – you choose the
languages you want based on the task at
hand and the skill-set of your team.
Advantages
http://vertx.io/
• Vert.x is lightweight - Vert.x core is around 650kB in size.
• Vert.x is fast. Here are some independent numbers.
• Vert.x is not an application server. There's no monolithic Vert.x instance into which you
deploy applications. You just run your apps wherever you want to.
• Vert.x is modular - when you need more bits just add the bits you need and nothing
more.
• Vert.x is simple but not simplistic. Vert.x allows you to create powerful apps, simply.
• Vert.x is an ideal choice for creating light-weight, high-performance, microservices.
Some things that Vert.x can do
• Core / Web (UDP / TCP / HTTP / Rest / Json / Xml)
• Data (MongoDB / JDBC Client / Redis Client / Spring data using JAVA language)
• Hibernate using JAVA language
• Mail Client
• Authentication and Authorisation
• Docker (Let you run Vert.x Applications in docker containers)
• Clustering(Hazelcast)
• Maven
• Spring framework using JAVA language
• and more...
Hands on

Reactive applications and microservices with Vert.x tool-kit

  • 1.
    Be happy. Reactiveapplications and Microservices with Vert.x tool-kit Victor Hugo / Recife-PE http://titorec.net
  • 2.
  • 3.
    What Reactive means? “Showing a response to a stimulus” Oxford “Tending to be responsive or to react to a stimulus.” http://www.thefreedictionary.com/reactive Response and react to a stimulus quickly
  • 4.
  • 5.
    Responsive A responsive systemis quick to answer to all users in beautiful ways or bad ways Rapid Consistent
  • 6.
    Resilient A resilient systemoffer an architecture type where bad days become good days A resilient system guarantees the availability of your service Replication Isolation Failover Load balance Fail tolerance
  • 7.
    Scalable A scalable systemis easy to increment when you need to answer several load types Scaling up (max memory) Scaling out (max childs on the cluster)
  • 8.
    Event driven A eventdriven system is based on events which are expected by one or more observers A event driven system is asynchronous where messages are delivered when the process end without block the thread where the event was fired
  • 9.
  • 10.
    Monolithic application HTML /JAVASCRIPT Movie Service Recommendation ServiceAnalysis ServiceRating Service User Service Data Access Application domain
  • 11.
    Microservices architecture HTML /JAVASCRIPT Movie Service Data Access HTML / JAVASCRIPT User Service Data Access HTML / JAVASCRIPT Rating Service Data Access HTML / JAVASCRIPT Recommendation Service Data Access HTML / JAVASCRIPT Analysis Service Data Access MySQL MySQL Neo4j MongoDB Spark Application domain
  • 12.
  • 13.
    Microservices characteristics • Automation •Continuous delivery • Decentralize the things • Each team take control about their deploys • Small teams (max of 4 people) • Does not necessary stop all services to deploy a new service • Easy scaling • Architecture fail tolerance (One fail does not stop all application) • Each service is elastic, resilient, composable, minimal, and complete • The services are small and easy to manage
  • 14.
    And now. Whowill help me ?
  • 15.
    Here is theanswer. Vert.x http://vertx.io/
  • 16.
    General purpose http://vertx.io/ Vert.x isincredibly flexible – whether it’s simple network utilities, sophisticated modern web applications, HTTP/REST microservices, high volume event processing or a full blown back-end message-bus application, Vert.x is a great fit. Vert.x is not restrictive framework or container and we don’t tell you a correct way to write an application. Instead we give you a lot of useful bricks and let you create your app the way you want to.
  • 17.
    Scale http://vertx.io/ Vert.x is eventdriven and non blocking. This means your app can handle a lot of concurrency using a small number of kernel threads. Vert.x lets you app scale with minimal hardware. Scale
  • 18.
  • 19.
    How the EventLoop(non-blocking) works If a thread to execute a long operation that does not use CPU like read or write data to disk other thread can be executed until the first operation to be finished maximizing the CPU use.
  • 20.
    Polyglot http://vertx.io/ You can useVert.x with multiple languages including Java, JavaScript, Groovy and Ruby. Vert.x doesn’t preach about what language is best – you choose the languages you want based on the task at hand and the skill-set of your team.
  • 21.
    Advantages http://vertx.io/ • Vert.x islightweight - Vert.x core is around 650kB in size. • Vert.x is fast. Here are some independent numbers. • Vert.x is not an application server. There's no monolithic Vert.x instance into which you deploy applications. You just run your apps wherever you want to. • Vert.x is modular - when you need more bits just add the bits you need and nothing more. • Vert.x is simple but not simplistic. Vert.x allows you to create powerful apps, simply. • Vert.x is an ideal choice for creating light-weight, high-performance, microservices.
  • 22.
    Some things thatVert.x can do • Core / Web (UDP / TCP / HTTP / Rest / Json / Xml) • Data (MongoDB / JDBC Client / Redis Client / Spring data using JAVA language) • Hibernate using JAVA language • Mail Client • Authentication and Authorisation • Docker (Let you run Vert.x Applications in docker containers) • Clustering(Hazelcast) • Maven • Spring framework using JAVA language • and more...
  • 23.