netty - a pragmatic introduction

15

Click here to load reader

Upload: raphael-stary

Post on 25-May-2015

2.832 views

Category:

Technology


1 download

DESCRIPTION

presentation for the 53rd JSUG Vienna meeting

TRANSCRIPT

Page 1: Netty - a pragmatic introduction

Netty.ioa pragmatic introduction

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

Page 2: Netty - a pragmatic introduction

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

Page 3: Netty - a pragmatic introduction

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.

Page 4: Netty - a pragmatic introduction

live coding :)

https://github.com/raphaelstary/jsug-netty-example

Page 5: Netty - a pragmatic introduction

companies

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

Page 6: Netty - a pragmatic introduction

open source projects

- HornetQ- Infinispan- Vert.x- Play Framework- Finangle- Cassandra...

Page 7: Netty - a pragmatic introduction

it's asynchronous ...

- no blocking IO- share Threads across many connections

Page 8: Netty - a pragmatic introduction

OIO

socket

read/write

Thread

socket

read/write

Thread

socket

read/write

Thread

socket

read/write

Thread

Page 9: Netty - a pragmatic introduction

NIO

socket

read/write

socket

read/write

socket

read/write

Thread

socket

read/write

selector

Page 10: Netty - a pragmatic introduction

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

Page 11: Netty - a pragmatic introduction

netty transports

- NIO- OIO- AIO- Local- Embedded

Page 12: Netty - a pragmatic introduction

supported protocols

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

Page 13: Netty - a pragmatic introduction

provided codecs

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

Page 14: Netty - a pragmatic introduction

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

Page 15: Netty - a pragmatic introduction

Netty

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