Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Netty at Twitter with Finagle
Search
Evan Meagher
July 29, 2014
Programming
4
360
Netty at Twitter with Finagle
A minimal set of slides used to present an overview of Finagle, an RPC library built atop Netty
Evan Meagher
July 29, 2014
Tweet
Share
More Decks by Evan Meagher
See All by Evan Meagher
Lessons Learned Writing Software at Whisker Labs
evanm
0
240
Other Decks in Programming
See All in Programming
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
230
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
4
880
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
1.4k
Making TCPSocket.new "Happy"!
coe401_
1
140
Develop Faster With FrankenPHP
dunglas
2
3.2k
「影響が少ない」を自分の目でみてみる
o0h
PRO
2
1k
List とは何か? / PHPerKaigi 2025
meihei3
0
740
Kamal 2 – Get Out of the Cloud
aleksandrov
1
180
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
趣味全開のAITuber開発
kokushin
0
190
Strategic Design (DDD)for the Frontend @DDD Meetup Stuttgart
manfredsteyer
PRO
0
110
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
160
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
76
9.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
Music & Morning Musume
bryan
47
6.5k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Producing Creativity
orderedlist
PRO
344
40k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Statistics for Hackers
jakevdp
798
220k
Transcript
@TwitterAds | Confidential Evan Meagher (@evanm) 7/28/14 Netty at Twitter
with Finagle
@Twitter 2 Agenda Why and what is Finagle? What does
it do? What are we working on now?
@Twitter 3 What is Finagle?
@Twitter 4 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 5 Why did we build Finagle?
@Twitter 6 In the beginning…
@Twitter 7 Monolithic Rails app MySQL
@Twitter 8 Monolithic Rails app MySQL Monolithic Rails app MySQL
Monolithic Rails app MySQL … Monolithic Rails app MySQL … …
@Twitter 9
@Twitter 10
@Twitter 11 What is Finagle?
@Twitter 12 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 13 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 14 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 15 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 16 An open source, protocol-agnostic, asynchronous RPC library for
the JVM
@Twitter 17 What does Finagle do?
@Twitter 18 Standardizes the edges in a “boxes and arrows”
network diagram
@Twitter 19 [1] http://monkey.org/~marius/funsrv.pdf
@Twitter 20 type Service[Req, Rep] = Req => Future[Rep]
@Twitter 21 type Service[Req, Rep] = Req => Future[Rep] Server
Client Req Future[Rep]
@Twitter 22 A contrived example
@Twitter 23 val server = new Service[HttpReq, HttpRep] { def
apply(req: HttpReq): Future[HttpRep] = Future.value(HttpRep(Status.OK, req.body)) } ! Http.serve(":80", server)
@Twitter 24 val client: Service[HttpReq, HttpRep] = Http.newService(“twitter.com:80") ! val
futureResponse: Future[HttpRep] = client(HttpReq(“/")) ! futureResponse map { response => println(response) }
@Twitter 25 Now let’s say you need to authenticate requests
@Twitter 26 type Service[Req, Rep] = Req => Future[Rep] !
type Filter[Req, Rep] = (Req, Service[Req, Rep]) => Future[Rep]
@Twitter 27 type Service[Req, Rep] = Req => Future[Rep] !
type Filter[Req, Rep] = (Req, Service[Req, Rep]) => Future[Rep] Filter Filter Server Client
@Twitter 28 def isAuthed(req: Req): Boolean val authFilter: Filter[HttpReq, HttpRes]
= { (req, svc) => if (isAuthed(req)) svc(req) else Future.exception(new AccessDenied) } ! val authedServer: Service[HttpReq, HttpRes] = authFilter andThen server
@Twitter 29 val instrumentedServer = authFilter andThen traceRequest andThen recordStats
andThen server
@Twitter 30 What are we working on now?
@Twitter 31 Service discovery See the “Names” page on the
Finagle user guide: http://twitter.github.io/finagle/guide/Names.html ! val client = Http.newService( “zk!myzkhost.mycompany.com:2181!/my/zk/path” )
@Twitter 32 Load balancing
@Twitter 33 Request multiplexing See the “Protocols” page on the
Finagle user guide: http://twitter.github.io/finagle/guide/Protocols.html
@Twitter 34 Tail-latency optimization
@TwitterAds | Confidential Thanks! github.com/twitter/finagle @finagle @evanm