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
370
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
260
Other Decks in Programming
See All in Programming
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
260
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.6k
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
2.3k
TROCCO×dbtで実現する人にもAIにもやさしいデータ基盤
nealle
0
330
The State of Fluid (2025)
s2b
0
200
TDD 実践ミニトーク
contour_gara
0
140
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
180
Langfuseと歩む生成AI活用推進
licux
3
300
令和最新版手のひらコンピュータ
koba789
14
8k
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
200
Honoアップデート 2025年夏
yusukebe
1
840
サイトを作ったらNFCタグキーホルダーを爆速で作れ!
yuukis
0
490
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
YesSQL, Process and Tooling at Scale
rocio
173
14k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
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