Vert.x 3 - high performance polyglot application platform

Vert.x 3 - high performance polyglot application platform

Vert.x is very efficient high performance scalable platform. Based on event driven paradigm with eventbus allows you to build non blocking thread safe asynchronous applications. Vert.x is easily scalable that can handle very high load of concurrent connections. Due to non blocking IO efficently uses server resources. It runs smoothly even on Raspberry Pi! That's awesome base for IoT solutions!

Another key feature of Vert.x is ability to use many programming languages in the same application. Vert.x supports Java, JavaScript, CoffeeScript, Ruby, Python, Groovy, Scala, Clojure and Ceylon. You can mix all of them in the same application using eventbus to communicate between pieces. Vert.x nicely handles concurrency so writing concurrent and yet thread safe code was never so easy. During the talk I'll show you live how to create simple and more advanced pieces of code. In 2014 Vert.x won Jax Innovation Award in Most innovative Java Technology category. Vertx 3.0 is on the way with it's premiere at 22 July 2015.

47969d3a306ab00ecd55dc0137d37463?s=128

Bartek Zdanowski

June 26, 2015
Tweet

Transcript

  1. vert.x v3 high performance polyglot application toolkit

  2. Hello! Bartek Zdanowski @bartekzdanowski 2

  3. Hello! developer @ vertx lover father and husband :) 3

  4. vert.x 4

  5. vert.x 5 Invented by Tim Fox as Node.x 24 June

    2015 - released v3 it’s very hot :D
  6. vert.x buzzwords simple embeddable toolkit threadSafe concurrent asynchronous eventDriven reactive

    eventBus scalable polyglot 6
  7. vert.x buzzwords fun 7

  8. the problem 8

  9. the problem number of mobile users raises 2,1 bln in

    2012 -> 7 bln in 2018 Internet of things - 30 bln in 2020! IPv4 is exhausted IPv6 is already ready for all of them 9
  10. the problem traditional blocking approach waiting for job to be

    done synchronous code scalability lots of threads concurrency that no-one understands ;) 10
  11. the problem Tomcat: 200 threads = 200 connections rest of

    incoming connections must wait… 11
  12. the problem one thread handles one task thread is waiting

    for job to finish whole queue of tasks waits traditional synchronous approach 12
  13. the problem big thread pools are evil synchronous is even

    more evil 13
  14. the problem 14 thread pools

  15. the problem 15 thread pools

  16. the solution 16

  17. the solution 17 thread pools

  18. the solution 18 1 task = series of loosely coupled

    events event that informs that new job/data is waiting
  19. the solution 19 program should release thread instead of waiting

    for operation (I/O) to be finished use non-blocking IO (NIO)
  20. the solution 20 asynchronous event driven

  21. the solution 21

  22. vert.x 22 dispatcher handlers thread pool reactor

  23. vert.x 23 handlers thread pool thread-1 handler 1 handler 2

  24. vert.x 24 multi-reactor pattern thread pool equals to double cores

    count actor like model
  25. show me 25

  26. threadsafe code 26

  27. threadsafe 27 class MyService { public synchronized Result doSomething(Data data)

    { //do some critical stuff } }
  28. threadsafe only when one thread! 28 class MyService { public

    synchronized Result doSomething(Data data) { //do some critical stuff } }
  29. 29 verticle

  30. 30 basic deployment unit actor-like model (akka similarity) always run

    in the same thread can have many instances classloader isolated verticle
  31. verticle threadsafe code ▪ verticle instance - always the same

    thread ▪ separated classloaders for each verticle instance 31
  32. verticle threadsafe code ▪ event bus separates threads ▪ shared

    data: maps, counters, locks 32
  33. 33 eventBus

  34. 34 eventBus

  35. 35 eventBus

  36. 36 eventBus server 1 server 2 server 3

  37. 37 eventBus server 1 webclient server 2 server 3

  38. 38 eventBus Publisher - subscriber publish() //broadcast like JMS Topics

  39. 39 eventBus Publisher - subscriber send() //point-to-point like JMS Queues

  40. 40 eventBus Publisher - subscriber send() //point-to-point like JMS Queues

    round robin
  41. 41 eventBus Publisher - subscriber send() //point-to-point like JMS Queues

    round robin
  42. 42 vert.x ecosystem

  43. 43 lightweight vert.x core extensions ▪ web ▪ data access

    (mongoDB, redis, JDBC) ▪ security (basic auth, jdbc auth, jwt, shiro) ▪ reactive (based on RxJava) ▪ others vert.x ecosystem
  44. 44 benchmarking

  45. 45 benchmarking https://www.techempower.com/benchmarks/#section=data-r8&hw=i7&test=plaintext

  46. 46 the buzzwords

  47. verticles like actors 47

  48. verticles are isolated 48

  49. threadSafe concurrent 49

  50. asynchronous & eventDriven 50

  51. eventBus 51

  52. scalable 52

  53. polyglot 53

  54. YOU getting started 54

  55. http://vertx.io/ https://github.com/vert-x3 use maven or gradle 55 YOU getting started

  56. grab a sticker! 56 YOU getting started

  57. have fun! 57 YOU getting started

  58. Q&A more demos 58

  59. I’m not the owner of the pictures used. Just found

    them on: http://www.rantchic.com/wp-content/uploads/2013/12/Apollo-13.jpg http://www.gamesaktuell.de/screenshots/1280x1024/2009/04/terminator_2_blu_ray03.jpg http://tripoutlook.com/wp-content/uploads/2013/03/Car-parking.jpg http://upload.wikimedia.org/wikipedia/commons/5/52/Parallel_Parking_cars.jpg http://www.foreverbarcelona.com/wp-content/uploads/2014/02/Taxi-Tips.png http://i.livescience.com/images/i/000/024/292/iFF/neurons-120208.jpg?1328727600 59 All the pics used
  60. 60 Gracias!