Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Finagle Overview
Search
Moses Nakamura
February 19, 2014
Technology
1.1k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Finagle Overview
Finagle Overview presented to the NY Scala Meetup
Moses Nakamura
February 19, 2014
Other Decks in Technology
See All in Technology
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
4
1.2k
hackers_champloo_2026_tidb
makocchi
0
170
Running Kotlin + Quarkus with Lambda
nealle
1
3.9k
今さら理解するウェブフォントver.2026
takanorip
3
890
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
専門領域のAIをどう評価するか
bengo4com
2
270
夫婦で子育てするための育児標準化
codmoninc
PRO
0
420
How to Design Configuration for Rails Applications
willnet
1
820
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
950
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
590
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Practical Orchestrator
shlominoach
192
12k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Marketing to machines
jonoalderson
1
5.9k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Transcript
Finagle
Hello!
Finagle Extensible RPC Implement a feature once => get the
feature in every service => get the feature in every protocol
Twitter Futures trait Future[+A] { def map[B](fn: A => B):
Future[B] def flatMap[B](fn: A => Future[B]): Future[B] def rescue[B](fn: PartialFunction[Throwable, Future [B]]): Future[B] def handle[B](fn: PartialFunction[Throwable, B]): Future [B] }
Twitter Futures Interrupts Maintain context Scheduler
Finagle Abstractions Service Server Client
Service trait Service[-Req, +Rep] extends (Req => Future[Rep])
Server trait Server[Req, Rep] { def serve( addr: SocketAddress, underlying:
Service[Req, Rep] ): ListeningServer }
Client trait Client[Req, Rep] { def newService( dest: Name, label:
String ): Service[Req, Rep] }
None
Load Balancing Load balances to the least loaded Internally organized
as a heap Implicitly sends more requests to faster servers
Liveness
Failure Accrual After X failures in a row, backoff for
duration Y
Rolling Restart Support If we can’t establish a connection to
a host, blackhole it and try to reestablish in the background “Fail Fast”
Connection Pooling Tunable parameters: Low Watermark High Watermark Idle Timeout
Max Waiters
Stats Collection We collect stats on every request, including histograms
of request latency, success rate etc. See: Metrics, Metrics Everywhere (codahale)
Distributed Tracing Hackweek project inspired by Dapper Sample a small
number of requests Lets you see which upstreams are pummeling your service during an incident Profiling is good for debugging average latency Tracing is good for debugging long tail latency
None
Pipelining Redis Memcached
Service Discovery trait ListeningServer { def announce(addr: String): Future[Announcement] }
Service Discovery ZK internally Other schemes Adding finagle-serversets to your
classpath enables ZK
Next?!
finagle 6 apis ClientBuilder => Protocol.new Cargo Culting :( Finagle
notoriously hard to configure Zero configuration! Works out of the box.
old style val client: Service[HttpRequest, HttpResponse] = ClientBuilder() .codec(Http()) .hosts(address)
.hostConnectionLimit(1) .tcpConnectTimeout(50.milliseconds) .failFast(true) .daemon(true) .retries(3) .trace(ZipkinTracer.mk(host, port) .build()
finagle 6 style Http.newService(name, label)
mux A new protocol, layered on other protocols cf. thrift-mux
mux discard leasing multiplexing error encoding ping drain initialization
error encoding Means you can handle errors separately by just
reading the first byte Easy to imagine dropping errors, or minimizing copies etc
init + ping True liveness No more failfast or failure
accrual
draining Signals that a server will start draining Client knows
to stop sending new requests
multiplexing Pipelining for everyone! Connection pooling mostly disappears
discard No longer care about response Current world: close connection
Biggest cause of connection churn New world: send a discard request
leasing First target: GC avoidance Useful elsewhere too
Finagle Resources twitter.github.io/finagle finaglers@google groups
Work on Finagle github.com/twitter/finagle Docs! Github Issues!
Thanks! twitter: @mnnakamura github: mosesn email:
[email protected]
Work for Twitter! https://twitter.com/jobs We’re hiring! t.co/nymeetup
Questions? https://twitter.com/jobs/engineering t.co/nymeetup email:
[email protected]