reactive applications and microservices with vert.x tool-kit
TRANSCRIPT
![Page 1: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/1.jpg)
Be happy. Reactive applications and Microservices with Vert.x tool-kitVictor Hugo / Recife-PEhttp://titorec.net
![Page 2: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/2.jpg)
Reactive applications
![Page 3: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/3.jpg)
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
![Page 4: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/4.jpg)
Reactive concepts
![Page 5: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/5.jpg)
ResponsiveA responsive system is quick to answer to all users in beautiful ways or bad ways
Rapid
Consistent
![Page 6: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/6.jpg)
ResilientA 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
![Page 7: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/7.jpg)
ScalableA 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)
![Page 8: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/8.jpg)
Event drivenA 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
![Page 9: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/9.jpg)
Microservices
![Page 10: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/10.jpg)
Monolithic applicationHTML / JAVASCRIPT
Movie Service Recommendation ServiceAnalysis ServiceRating Service User Service
Data Access
Application domain
![Page 11: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/11.jpg)
Microservices architectureHTML / 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
![Page 12: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/12.jpg)
Microservices communication
![Page 13: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/13.jpg)
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
![Page 14: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/14.jpg)
And now. Who will help me ?
![Page 16: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/16.jpg)
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.
![Page 17: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/17.jpg)
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
![Page 18: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/18.jpg)
Vert.x architecture
![Page 19: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/19.jpg)
How the Event Loop(non-blocking) worksIf 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.
![Page 20: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/20.jpg)
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.
![Page 21: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/21.jpg)
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.
![Page 22: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/22.jpg)
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...
![Page 23: Reactive applications and microservices with Vert.x tool-kit](https://reader034.vdocuments.net/reader034/viewer/2022051520/58ecf6f31a28abf5758b458d/html5/thumbnails/23.jpg)
Hands on