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
220
Other Decks in Programming
See All in Programming
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
たのしいparse.y
ydah
3
120
return文におけるstd::moveについて
onihusube
1
770
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
660
バグを見つけた?それAppleに直してもらおう!
uetyo
0
170
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
CSC305 Lecture 26
javiergs
PRO
0
140
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
事業成長を爆速で進めてきたプロダクトエンジニアたちの成功談・失敗談
nealle
3
1.4k
Featured
See All Featured
Docker and Python
trallard
41
3.1k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Designing for humans not robots
tammielis
250
25k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
A designer walks into a library…
pauljervisheath
204
24k
The Language of Interfaces
destraynor
154
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Why Our Code Smells
bkeepers
PRO
335
57k
Into the Great Unknown - MozCon
thekraken
33
1.5k
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