PRODUCTION READY VERT.X
Berlin | 30.04.2014
TABLE OF CONTENTS
1. Introduction
2. The Beginning
3. What is Vert.x?
4. How to start?
5. Infrastructure as code
6. Vert.x...
INTRODUCTION ZANOX
Europe‘s leading performance advertising network
3Berlin | 2014 | zanox | JUG BB
THE BEGINNING
4Berlin | 2014 | zanox | JUG BB
Java Magazin 04.14:
Vert.x im Unternehmenseinsatz
Entwicklung und Betrieb vo...
THE BEGINNING
● New request processing-system for Zanox
● Requirements are pretty high (not negotiable):
● Low latency
● H...
THE BEGINNING
6Berlin | 2014 | zanox | JUG BB
“Vert.x is a lightweight, high performance application
platform for the JVM that's designed for modern
mobile, web, and en...
WHAT IS VERT.X?
8Berlin | 2014 | zanox | JUG BB
Polyglot
WHAT IS A VERTICLE?
● Classes with an own Classloader
● operates Single Threaded
● executed by an Event Loop
9Berlin | 201...
10Berlin | 2014 | zanox | JUG BB
Event Loop Pool
Event Bus
V V V W W W
TAKE A LOOK INSIDE
WHAT‘S DEEP INSIDE?
● Build on top of Netty 4
● Uses Hazelcast for node discovery
● Jackson for JSON
● Java7+
11Berlin | 2...
HOW TO START?
● Prerequisite: JDK 7
● download and unzip file from vertx.io
● put /bin directory to PATH variable
12Berlin...
HOW TO START?
● mvn archetype:generate -Dfilter=io.vertx:
(do not forget the colon!)
● generates structure for all languag...
HOW TO START?
14Berlin | 2014 | zanox | JUG BB
BEST PRACTICES
15Berlin | 2014 | zanox | JUG BB
BEST PRACTICES
● do not block the loop
● put blocking code or extensive computation into
worker verticles
● keep the appli...
INFRASTRUCTURE AS CODE
17Berlin | 2014 | zanox | JUG BB
INFRASTRUCTURE AS CODE
18Berlin | 2014 | zanox | JUG BB
"CHEF IS LIKE A LITTLE SYSTEM
ADMIN ROBOT ... YOU TELL IT
HOW YOU ...
INFRASTRUCTURE AS CODE
19Berlin | 2014 | zanox | JUG BB
INFRASTRUCTURE AS CODE
20Berlin | 2014 | zanox | JUG BB
Chef Cookbook
INFRASTRUCTURE AS CODE
21Berlin | 2014 | zanox | JUG BB
VERT.X MODULE SYSTEM
● Vert.x has a powerful module system.
● Package your Vert.x components into modules for
encapsulatio...
VERT.X MODULE SYSTEM
● Share your modules with the community by putting
them in Maven Central, any other Maven repository,...
VERT.X MODULE REGISTRY
● Just fill in the form and wait for approval:
24Berlin | 2014 | zanox | JUG BB
INTEGRATION WITH MESSAGING
SYSTEM
● Apache Kafka is a publish-subscribe messaging
implemented as a distributed commit log....
INTEGRATION WITH MESSAGING
SYSTEM
● Topic - categories for feeds of messages
● Producer - publishes messages to topics
● C...
KAFKA MODULE
● Application sends messages to Kafka module using
Vert.x event bus
● Kafka module acts as a producer
● Avail...
KAFKA MODULE IN MODULE REGISTRY
Open sourced Kafka module in Vert.x’s module registry -
http://modulereg.vertx.io/
28Berli...
USING VERT.X MODULE
First, deploy the module into your application:
container.deployModule("com.zanox.vertx~mo
d-kafka~1.0...
USING KAFKA MODULE
JsonObject config = new JsonObject();
config.putString("kafka-topic", ‘kafka_topic“);
config.putString(...
METRICS OF VERT.X PROJECT
● On 4 Cores virtual machine we had the following
results:
● ~28 K requests per second without K...
32Berlin | 2014 | zanox | JUG BB
Upcoming SlideShare
Loading in...5
×

Production ready Vert.x

5,502

Published on

How to make your Vert.x setup ready for production

Published in: Software, Technology, Travel
1 Comment
13 Likes
Statistics
Notes
  • Cool! Just curious how you guys do your stress tests?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
5,502
On Slideshare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
70
Comments
1
Likes
13
Embeds 0
No embeds

No notes for slide

Transcript of "Production ready Vert.x"

  1. 1. PRODUCTION READY VERT.X Berlin | 30.04.2014
  2. 2. TABLE OF CONTENTS 1. Introduction 2. The Beginning 3. What is Vert.x? 4. How to start? 5. Infrastructure as code 6. Vert.x module system 7. Integration with messaging system 8. Kafka module 2Berlin | 2014 | zanox | JUG BB
  3. 3. INTRODUCTION ZANOX Europe‘s leading performance advertising network 3Berlin | 2014 | zanox | JUG BB
  4. 4. THE BEGINNING 4Berlin | 2014 | zanox | JUG BB Java Magazin 04.14: Vert.x im Unternehmenseinsatz Entwicklung und Betrieb von asynchronen Applikationen mit Vert.x in der Praxis
  5. 5. THE BEGINNING ● New request processing-system for Zanox ● Requirements are pretty high (not negotiable): ● Low latency ● High throughput ● Scalable ● Resilient ● Responsive ● Event-Driven ● Fast 5Berlin | 2014 | zanox | JUG BB
  6. 6. THE BEGINNING 6Berlin | 2014 | zanox | JUG BB
  7. 7. “Vert.x is a lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications.” Vert.x WHAT IS VERT.X? 7Berlin | 2014 | zanox | JUG BB
  8. 8. WHAT IS VERT.X? 8Berlin | 2014 | zanox | JUG BB Polyglot
  9. 9. WHAT IS A VERTICLE? ● Classes with an own Classloader ● operates Single Threaded ● executed by an Event Loop 9Berlin | 2014 | zanox | JUG BB
  10. 10. 10Berlin | 2014 | zanox | JUG BB Event Loop Pool Event Bus V V V W W W TAKE A LOOK INSIDE
  11. 11. WHAT‘S DEEP INSIDE? ● Build on top of Netty 4 ● Uses Hazelcast for node discovery ● Jackson for JSON ● Java7+ 11Berlin | 2014 | zanox | JUG BB
  12. 12. HOW TO START? ● Prerequisite: JDK 7 ● download and unzip file from vertx.io ● put /bin directory to PATH variable 12Berlin | 2014 | zanox | JUG BB
  13. 13. HOW TO START? ● mvn archetype:generate -Dfilter=io.vertx: (do not forget the colon!) ● generates structure for all languages (JS, Ruby, Groovy, Python) ● maven pom is already set with relevant data 13Berlin | 2014 | zanox | JUG BB
  14. 14. HOW TO START? 14Berlin | 2014 | zanox | JUG BB
  15. 15. BEST PRACTICES 15Berlin | 2014 | zanox | JUG BB
  16. 16. BEST PRACTICES ● do not block the loop ● put blocking code or extensive computation into worker verticles ● keep the application responsive ● stress test as often as possible ● encapsulate common code in modules (more on this later) 16Berlin | 2014 | zanox | JUG BB
  17. 17. INFRASTRUCTURE AS CODE 17Berlin | 2014 | zanox | JUG BB
  18. 18. INFRASTRUCTURE AS CODE 18Berlin | 2014 | zanox | JUG BB "CHEF IS LIKE A LITTLE SYSTEM ADMIN ROBOT ... YOU TELL IT HOW YOU WANT YOUR SYSTEM CONFIGURED, AND IT WILL DO ALL THE DIRTY WORK.”
  19. 19. INFRASTRUCTURE AS CODE 19Berlin | 2014 | zanox | JUG BB
  20. 20. INFRASTRUCTURE AS CODE 20Berlin | 2014 | zanox | JUG BB Chef Cookbook
  21. 21. INFRASTRUCTURE AS CODE 21Berlin | 2014 | zanox | JUG BB
  22. 22. VERT.X MODULE SYSTEM ● Vert.x has a powerful module system. ● Package your Vert.x components into modules for encapsulation and reuse. ● The module is a zip file ● It can be just plugged in into your application 22Berlin | 2014 | zanox | JUG BB
  23. 23. VERT.X MODULE SYSTEM ● Share your modules with the community by putting them in Maven Central, any other Maven repository, or in Bintray. ● Advertise your module in the module registry. 23Berlin | 2014 | zanox | JUG BB
  24. 24. VERT.X MODULE REGISTRY ● Just fill in the form and wait for approval: 24Berlin | 2014 | zanox | JUG BB
  25. 25. INTEGRATION WITH MESSAGING SYSTEM ● Apache Kafka is a publish-subscribe messaging implemented as a distributed commit log. ● Fast ● Scalable ● Durable ● Distributed 25 KAFKA MESSAGING SYSTEM Berlin | 2014 | zanox | JUG BB
  26. 26. INTEGRATION WITH MESSAGING SYSTEM ● Topic - categories for feeds of messages ● Producer - publishes messages to topics ● Consumer - subscribes to topics and process the feed of published messages consumers ● Broker - Kafka is run as a cluster comprised of one or more servers each of which is called a broker. 26 MAIN TERMINOLOGY: Berlin | 2014 | zanox | JUG BB
  27. 27. KAFKA MODULE ● Application sends messages to Kafka module using Vert.x event bus ● Kafka module acts as a producer ● Available on Maven Central and Vert.x module registry 27Berlin | 2014 | zanox | JUG BB
  28. 28. KAFKA MODULE IN MODULE REGISTRY Open sourced Kafka module in Vert.x’s module registry - http://modulereg.vertx.io/ 28Berlin | 2014 | zanox | JUG BB
  29. 29. USING VERT.X MODULE First, deploy the module into your application: container.deployModule("com.zanox.vertx~mo d-kafka~1.0.2", config); 29Berlin | 2014 | zanox | JUG BB
  30. 30. USING KAFKA MODULE JsonObject config = new JsonObject(); config.putString("kafka-topic", ‘kafka_topic“); config.putString("metadata.broker.list", “localhost:9092”); config.putString("request.required.acks", "1"); 30 CONFIGURATION IS A JSON OBJECT: Berlin | 2014 | zanox | JUG BB
  31. 31. METRICS OF VERT.X PROJECT ● On 4 Cores virtual machine we had the following results: ● ~28 K requests per second without Kafka, with lookup from Redis ● ~18 K requests per second with Kafka and lookup from Redis 31Berlin | 2014 | zanox | JUG BB
  32. 32. 32Berlin | 2014 | zanox | JUG BB
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×