Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Resilient Software Design
Swanand Pagnis
January 21, 2015
Technology
1
170
Resilient Software Design
Lessons learned from Michal Nygard's "Release It!"
Swanand Pagnis
January 21, 2015
Tweet
Share
More Decks by Swanand Pagnis
See All by Swanand Pagnis
Fearless Joins
swanandp
0
140
The Deep Work Divide: Restoring the balance between collaboration and deep work
swanandp
0
530
The Well Rounded Engineer
swanandp
20
5.9k
The Deep Work Mentality
swanandp
5
1.4k
Combinator Parsing
swanandp
0
390
It's 2017, and I still want to sell you a graph database
swanandp
2
480
Architecture Over Framework: Rethink Your App Structure
swanandp
1
160
Let's get real (time): SSE, WebSockets and WebRTC for the soul
swanandp
2
700
Build your first MapReduce with Hadoop and Ruby
swanandp
3
3.1k
Other Decks in Technology
See All in Technology
スクラムのスケールとチームトポロジー / Scaled Scrum and Team Topologies
daiksy
1
400
JSAI 2022チュートリアル講演 AI哲学マップ / JSAI 2022 Tutorial "AI Philosophy Map"
ykiyota
0
390
What's new in Vision
satotakeshi
0
160
The role of the data organization as a business progresses
line_developers
PRO
3
820
LINEのB2Bプラットフォームにおけるトラブルシューティング2選
line_developers
PRO
3
280
WACATE 2022 夏 ワークショップの目的
imtnd
0
110
雑な攻撃からELBを守る一工夫 +おまけ / Know-how to protect servers from miscellaneous attacks
hiroga
0
430
CADDi AI LabにおけるマネージドなMLOps
vaaaaanquish
2
1.4k
suppress-ts-errors を使って TypeScriptの型チェックを漸進的に強化する / Introducing-suppress-ts-errors
kawamataryo
2
110
JUnit5.7, 5.8の新機能紹介 #jjug_ccc #jjug_ccc_b / junit 5.7, 5.8 new features
kyonmm
PRO
2
400
Modern Android dependency injection
hugovisser
1
120
視座とアジャイル / shiza_and_agile
kyoshimoto
0
180
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
86
12k
Web development in the modern age
philhawksworth
197
9.3k
Testing 201, or: Great Expectations
jmmastey
21
5.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
19
1.4k
Building Flexible Design Systems
yeseniaperezcruz
310
34k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
Typedesign – Prime Four
hannesfritz
33
1.3k
BBQ
matthewcrist
74
7.9k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.4k
No one is an island. Learnings from fostering a developers community.
thoeni
9
1.3k
Documentation Writing (for coders)
carmenhchung
48
2.5k
Building an army of robots
kneath
299
40k
Transcript
Resilient Software Design Building software that doesn’t give up!
1. What’s all this about? 2. Anti-patterns: What not to
do! 3. Patterns: Make your life easier.
Find the odd one 1. :cloud_factory 2. "CloudFactory" 3. CloudFactory
4. CLOUD_FACTORY
What will this code print? if fork puts "I won
the lottery!" else puts "I am bankrupt!" end
What’s all this about?
Stability
It Just Works™
It Should Work™
Bad things happen
Good things happen as well
But those are rare!
Anything that can go wrong, will go wrong. - Murphy’s
Law
Developers think positive
Too much so!
Be negative.
Our goal is to build software
Our goal is also to minimise pain
Our goal is also to save money
Resilient software saves money by not breaking when needed
Resilient software saves money by using optimum infrastructure
Resilient software saves money by keeping developers happy
Anti-patterns
1. Integration points
Integration is not what you think™
Database is an integration
Third party services are integration.
Your cache layer is an integration
None
Networks fail more often
Socket based protocols have a special way of failing
Refused connection is bad.
Hanged connection is worse.
Micro-services that talk to each other, will stop talking abruptly
2. Unbalanced Capacities
Specially applicable to micro-services
3. Slow responses
4. Unbounded Result Sets
Major anti-pattern, overlooked by many
What is the size of an HTTP cookie?
Patterns
1. Use timeouts!
What is the default timeout on Ruby’s net/http?
Now and forever, networks will always be unreliable. - Michael
T Nygard
Every network call in your system must have a timeout
This includes database calls
This includes API calls
This includes cache lookups
What to do when the timeout occurs depends on where
it occurred
Highly context specific, so the dev team should make that
decision
ProTip: Do not use Ruby’s “timeout” module
Instead, depend on libraries for the timeout
If you’re a library author, just use net/http’s timeout
2. Circuit Breaker
None
3. Bulkheads
A ship is divided into several water- tight compartments
In case there is a leakage in one section, water
doesn’t flood into other sections
Same principle!
Use resource pools
Use rate limiting
Consideration: Capacity
Bulkheading often conflicts increasing or variable capacity
Consideration: Performance
Bulkheading often results in slightly reduced performance
It’s worth it, trust me™
4. Fail fast
Remember guard clauses in Ruby?
# class Event def closest_event return unless self.location # …
# … end
Same principle!
Any Ruby libraries?
Not a lot :(
shopify/semian
Thank you!
Questions?
Swanand Pagnis Principal Engineer @ First
Swanand Pagnis @_swanand on Twitter
Swanand Pagnis @swanandp on GitHub