netty - a pragmatic introduction

Post on 25-May-2015

2.832 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

presentation for the 53rd JSUG Vienna meeting

TRANSCRIPT

Netty.ioa 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: @RaphaelStaryfacebook.com/RaphaelStarygithub.com/RaphaelStaryxing.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

top related