SLIDE 1 Help! I accidentally distributed my system!
Rachel Myers, Emily Nakashima
SLIDE 2 @rachelmyers, @eanakashima
@eanakashima
SLIDE 3 @rachelmyers, @eanakashima
SLIDE 4 @rachelmyers, @eanakashima
@rachelmyers
SLIDE 5 @rachelmyers, @eanakashima
SLIDE 6 @rachelmyers, @eanakashima
SLIDE 7 @rachelmyers, @eanakashima ModCloth
Web App
(Rails) MySQL
User request (from NGINX & loadbalancer)
SLIDE 8 @rachelmyers, @eanakashima
What even is
a distributed system?
SLIDE 9 @rachelmyers, @eanakashima What even is a distributed system?
Some
Node Another Node
SLIDE 10 @rachelmyers, @eanakashima
Designing distributed systems
- What are the “nouns” in my system?
- What are the patterns for reading data?
- What are the patterns for writing data?
- Do different flows have different performance, consistency,
& availability requirements?
👓
SLIDE 11 @rachelmyers, @eanakashima ModCloth
Web App MySQL
User request (from NGINX & loadbalancer)
Mobile
SLIDE 12 @rachelmyers, @eanakashima ModCloth
Web App MySQL
User request (from NGINX & loadbalancer)
Mobile
Voting Service
MySQL
SLIDE 13 @rachelmyers, @eanakashima ModCloth
Web App MySQL Identity Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service
MySQL
SLIDE 14 @rachelmyers, @eanakashima ModCloth
Web App MySQL Identity Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service
MySQL MySQL
SLIDE 15 @rachelmyers, @eanakashima ModCloth
Web App MySQL Identity Service Photo Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service Comment Service
MySQL MySQL MySQL MySQL
SLIDE 16 @rachelmyers, @eanakashima ModCloth
Web App MySQL Identity Service Photo Service Moderation Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service Comment Service
MySQL MySQL MySQL MySQL MySQL
SLIDE 17 @rachelmyers, @eanakashima ModCloth
Web App MySQL Checkout Service Identity Service Photo Service Moderation Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service Comment Service
MySQL MySQL MySQL MySQL MySQL MySQL
SLIDE 18 @rachelmyers, @eanakashima ModCloth
Web App MySQL Checkout Service Identity Service Photo Service Moderation Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service Comment Service
MySQL MySQL MySQL MySQL MySQL MySQL 🔦
🗒
SLIDE 19 @rachelmyers, @eanakashima ModCloth
Web App MySQL Checkout Service Identity Service Photo Service Moderation Service
User request (from NGINX & loadbalancer)
Mobile
MySQL
Voting Service Asset Service Comment Service
MySQL MySQL MySQL MySQL MySQL MySQL
😈😈😈 🤔🤔🤔
SLIDE 20 @rachelmyers, @eanakashima
And this was intentional 😃
SLIDE 21 @rachelmyers, @eanakashima
An accidental distributed system ⛈
flexfits.com
SLIDE 22 @rachelmyers, @eanakashima flexfits.com
SLIDE 23 @rachelmyers, @eanakashima flexfits.com
Ecommerce SaaS
User request
SLIDE 24 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS
User request
SLIDE 25 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS Fulfillment SaaS
User request
SLIDE 26 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS Metrics SaaS Fulfillment SaaS
User request
SLIDE 27 @rachelmyers, @eanakashima flexfits.com
SLIDE 28 @rachelmyers, @eanakashima flexfits.com
👒 👒
SLIDE 29 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS Metrics SaaS Fulfillment SaaS
User request
?
SLIDE 30 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS Metrics SaaS Fulfillment SaaS
User request
Orders Service
Postgres
SLIDE 31 @rachelmyers, @eanakashima flexfits.com
Subscription Plugin SaaS
Ecommerce SaaS Metrics SaaS Fulfillment SaaS
User request
Orders Service
Postgres
👓
SLIDE 32 @rachelmyers, @eanakashima
New requirements for buy vs build
SLIDE 33 @rachelmyers, @eanakashima flexfits.com
SaaS
SaaS SaaS SaaS
User request
Home cooked
SLIDE 34 @rachelmyers, @eanakashima
Buy or Build
- Will it improve availability?
- Will it improve recovery?
- Will you have visibility or points of control?
- Will you have customizability?
- Will you know when your changes take effect?
- Can you audit changes?
SLIDE 35 @rachelmyers, @eanakashima
IaaS, PaaS, BaaS, & FaaS
SLIDE 36 @rachelmyers, @eanakashima
Cloud Infrastructure
SLIDE 37 @rachelmyers, @eanakashima
IaaS
SLIDE 38 @rachelmyers, @eanakashima
IaaS
- Will it improve availability? ✅
- Will it improve recovery? ✅
- Will you have visibility or points of control? ✅
- Will you have customizability? ✅
- Will you know when your changes take effect? ✅
- Can you audit changes? ✅
SLIDE 39 @rachelmyers, @eanakashima
Platforms
SLIDE 40 @rachelmyers, @eanakashima
PaaS
SLIDE 41 @rachelmyers, @eanakashima
PaaS
- Will it improve availability? ✅
- Will it improve recovery? 🤕
- Will you have visibility or points of control? ✅
- Will you have customizability? ✅
- Will you know when your changes take effect? 🤕
- Can you audit changes? 🤕
SLIDE 42 @rachelmyers, @eanakashima
Backends
SLIDE 43 @rachelmyers, @eanakashima
BaaS
(RIP Parse)
SLIDE 44 @rachelmyers, @eanakashima
BaaS
- Will it improve availability? ✅🤕
- Will it improve recovery? 🤕
- Will you have visibility or points of control? 🤕
- Will you have customizability? ✅
- Will you know when your changes take effect? 🤕
- Can you audit changes? 🤕
SLIDE 45 @rachelmyers, @eanakashima
Functions
SLIDE 46 @rachelmyers, @eanakashima
FaaS
SLIDE 47 @rachelmyers, @eanakashima
FaaS
- Will it improve availability? 🤕
- Will it improve recovery? 🤕
- Will you have visibility or points of control? 🤕
- Will you have customizability? ✅
- Will you know when your changes take effect? 🤕
- Can you audit changes? 🤕
SLIDE 49 @rachelmyers, @eanakashima
Infrastructure
Platform
Backend
Faster to start Harder to change
SLIDE 50 @rachelmyers, @eanakashima
SLIDE 51 @rachelmyers, @eanakashima
SLIDE 52 @rachelmyers, @eanakashima
Surprise Distributed Systems
SLIDE 53 @rachelmyers, @eanakashima
Surprise distributed system: browsers
SLIDE 54 @rachelmyers, @eanakashima
“The browser is part of your distributed system, not just a client you support”
SLIDE 55 @rachelmyers, @eanakashima
The one where we DDOS’d ourselves
SLIDE 56 @rachelmyers, @eanakashima
What happened?
SLIDE 57 @rachelmyers, @eanakashima
// if the page is long enough to scroll if (document.body.clientHeight > window.innerHeight) { // add a scroll event listener document.addEventListener('scroll', function(e) { // if within 100px of the bottom of the page if (window.innerHeight + window.scrollY + 100 > document.body.clientHeight) fetchNextPage(); }); // else fetch another page of results immediately } else { fetchNextPage(); }
SLIDE 58 @rachelmyers, @eanakashima
Frontend complexity is only increasing
SLIDE 59 @rachelmyers, @eanakashima
Instrumentation Rule 1: Start at the edge.
Corollary: The edge may be further than you think.
SLIDE 60 @rachelmyers, @eanakashima
Secret distributed system: vendors
SLIDE 61 @rachelmyers, @eanakashima
LaunchDarkly
SLIDE 62 @rachelmyers, @eanakashima
Secret distributed system: vendors
SLIDE 63 @rachelmyers, @eanakashima
# instantiate the flag with a default value # falls back to default value if service is offline show_feature = ld_client.variation( "allow_traces", { :key => "user@example.com" }, false ) if show_feature # application code to show the feature else # the code to run if the feature is off
SLIDE 64 @rachelmyers, @eanakashima
Secret distributed system: vendors
SLIDE 65 @rachelmyers, @eanakashima
Instrumentation Rule 2:
Wrap 3rd party calls
SLIDE 66 @rachelmyers, @eanakashima
Secret distributed system: vendors
SLIDE 67 @rachelmyers, @eanakashima
GitHub’s customer support application
SLIDE 68 @rachelmyers, @eanakashima GitHub customer support tool
github.com
Customer Support Tool
User email
SLIDE 69 @rachelmyers, @eanakashima GitHub customer support tool
github.com
Customer Support Tool GMail
User email
SLIDE 70 @rachelmyers, @eanakashima GitHub customer support tool
github.com
MailChimp Customer Support Tool GMail
User email
SendGrid
SLIDE 71 @rachelmyers, @eanakashima GitHub customer support tool
github.com
MailChimp Customer Support Tool GMail
User email
SendGrid
SLIDE 72 @rachelmyers, @eanakashima GitHub customer support tool
github.com
Kafka Customer Support Tool Ingest service
User email
Outbound mail service
SLIDE 73 @rachelmyers, @eanakashima GitHub customer support tool
github.com
Kafka Customer Support Tool Ingest service
User email
Outbound mail service 🔦
🗒
SLIDE 74 @rachelmyers, @eanakashima GitHub customer support tool
github.com
MailChimp Customer Support Tool GMail
User email
SendGrid
SLIDE 75 @rachelmyers, @eanakashima
Cognitive Load
SLIDE 76 @rachelmyers, @eanakashima
Instrumentation & Chill ❄
SLIDE 77 @rachelmyers, @eanakashima
Fewer Alerts 📠
SLIDE 78 @rachelmyers, @eanakashima
SLIDE 79 @rachelmyers, @eanakashima
Unknown unknown unknowns 🔦
SLIDE 80 @rachelmyers, @eanakashima
Outsource Your Brain 📙
SLIDE 81 @rachelmyers, @eanakashima
Use tools that let you…
- Ask, what is happening now to this user? Endpoint? Team?
- Ask, how does this compare to the aggregate case?
- Jump between levels of abstraction
- See both breadth & depth
- Understand how data flows
SLIDE 82 @rachelmyers, @eanakashima
Observability… not just for
SLIDE 83 @rachelmyers, @eanakashima
“The ability to ask arbitrary questions about your system from the outside, and understand what is happening on the inside.”
SLIDE 84 @rachelmyers, @eanakashima
logs metrics
traces / events
SLIDE 85 @rachelmyers, @eanakashima
How to pick an
SLIDE 86 @rachelmyers, @eanakashima
Crawl the pipes
SLIDE 87 @rachelmyers, @eanakashima flexfits.com
SLIDE 88 @rachelmyers, @eanakashima
No really, instrumentation
SLIDE 89 @rachelmyers, @eanakashima
SLIDE 90 @rachelmyers, @eanakashima
# monitoring endpoint Location ~ /ping { return 200 '200 ok'; }
SLIDE 91 @rachelmyers, @eanakashima
Instrumentation Rule 3:
Your instrumentation should support depth- *and* breadth-first
SLIDE 92 @rachelmyers, @eanakashima
Conclusion
SLIDE 93 @rachelmyers, @eanakashima
Two Vendors: Two Conclusions 😭
SLIDE 94 @rachelmyers, @eanakashima
systems engineers
☎ 🐣
SLIDE 95 @rachelmyers, @eanakashima
🛡
SLIDE 96 @rachelmyers, @eanakashima
Thank you