Netty - a pragmatic introduction

darth_baghira 5,561 views 15 slides May 07, 2013
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

presentation for the 53rd JSUG Vienna meeting


Slide Content

Netty.io
a pragmatic introduction
(live coding https://github.com/raphaelstary/jsug-netty-example)

Raphael Stary
- software dev
(w/ focus on html5, js, java, (java ee), ux, agile,
software craftsmanship)

- founder of letsplay.io - open web game
studio

twitter: @RaphaelStary
facebook.com/RaphaelStary
github.com/RaphaelStary
xing.com/profile/Raphael_Stary

what's netty?
Netty is a NIO client server
framework which enables
quick and easy development
of network applications such
as protocol servers and
clients.

live coding :)
https://github.com/raphaelstary/jsug-netty-example

companies
- Red Hat
- Twitter
- Facebook
- Boundary
- Typesafe
...

open source projects
- HornetQ
- Infinispan
- Vert.x
- Play Framework
- Finangle
- Cassandra
...

it's asynchronous ...
- no blocking IO
- share Threads across many
connections

OIO
socket
read/write
Thread
socket
read/write
Thread
socket
read/write
Thread
socket
read/write
Thread

NIO
socket
read/write
socket
read/write
socket
read/write
Thread
socket
read/write
selector

blocking IO scales not that good ...
- a Thread takes memory from 256kb to 1mb
for the stack space

- it's good with <1000 connections (even better
latency than NIO)

- but >1000 concurrent connections use AIO or
NIO

netty transports
- NIO
- OIO
- AIO
- Local
- Embedded

supported protocols
- TCP
- UDP
- SCTP (linux only)
- UDT
- Serial

provided codecs
- HTTP
- Websocket
- SPDY
- Serialization
- JBoss Marshalling
- Protobufs
- SSL
- Zlib

how to get started
- MEAP preview




- http://netty.io/wiki/user-guide-for-4.x.html
- https://github.com/netty/netty/tree/master/example
- stackoverflow examples
- source code java docs

Netty
- http://netty.io
- https://github.com/netty/netty
- twitter: @netty_project