vert.x - life beyond jetty and apache

21
vert.x life beyond jetty & apache

Transcript of vert.x - life beyond jetty and apache

vert.xlife beyond jetty & apache

The C10k Problem

How to handle 10000+ parallel connections?

But why should I? For online banking?!?

Nope. „The internet of Things“, Social Web

The Internet of Things

Wired: Up to 50.000.000.000 devices until 2020

Social Web

The C10k Problem

Increasing challenge to handle a large number of concurrent clients / connections in a high performance environment

Check. No problem any more.

But how did we solve this?!?

Time flies ...

... when you‘re idle

250 MIPS on MBAir, 7 TFLOPS on Mac Pro

Bad processes

Bad threading

Bad, bad I/O

Time flies ...

L1-cache ... 3 cycles

L2-cache ... 14 cycles

RAM ... 250 cycles

Disk ... 41.000.000 cycles

Network ... 240.000.000 cycles

And the winner is

single threading

asynchronicity

nginx, akka, node, LMAXvert.x

Reactor Pattern

single threadedeventloop

clien

ts

workers thread pool

callbacks (events)

everything runs in parallelexcept your code

Babel ... my ass!

No JVM in the Old Testament

JavaScript, Ruby, Python, Groovy, Java ...

True polyglot within a single application

Verticlesvertx run app.js

var console = require('vertx/console');

console.log("hello, this is vert.x speaking");

Verticlesvertx run App.java

import org.vertx.java.platform.Verticle;

public class App extends Verticle { public void start() { System.out.println("hello, speaking java right now"); } }

Verticlesvertx run app.js

Verticlesvertx run loader.js

var container = require('vertx/container');

container.deployVerticle("app.js"); container.deployVerticle("App.java");

Verticlesvertx run app.js -instances 4

EventBus

EventBus

send(„myQ“, msg);

registerHandler(„myQ“,);

Clustervertx run app.js -instances 4 -cluster

EventBus<script src=“vertxbus.js“/>

Happy Coding!

Java 7 (Closures, dynamically typed languages)

vertx.io

EditorHacking Days 2013

Up next ...

The C10M Problem

Check? Well, maybe ...

Prism