mike krieger, instagram at the airbnb tech talk, on scaling instagram
DESCRIPTION
on TechCrunch http://techcrunch.com/2012/04/12/how-to-scale-a-1-billion-startup-a-guide-from-instagram-co-founder-mike-kriegerTRANSCRIPT
![Page 1: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/1.jpg)
Scaling InstagramAirBnB Tech Talk 2012
Mike KriegerInstagram
![Page 2: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/2.jpg)
me
- Co-founder, Instagram
- Previously: UX & Front-end@ Meebo
- Stanford HCI BS/MS
- @mikeyk on everything
![Page 3: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/3.jpg)
![Page 4: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/4.jpg)
![Page 5: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/5.jpg)
![Page 6: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/6.jpg)
communicating and sharing in the real world
![Page 7: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/7.jpg)
30+ million users in less than 2 years
![Page 8: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/8.jpg)
the story of how we scaled it
![Page 9: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/9.jpg)
a brief tangent
![Page 10: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/10.jpg)
the beginning
![Page 11: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/11.jpg)
Text
![Page 12: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/12.jpg)
2 product guys
![Page 13: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/13.jpg)
no real back-end experience
![Page 14: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/14.jpg)
analytics & python @ meebo
![Page 15: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/15.jpg)
CouchDB
![Page 16: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/16.jpg)
CrimeDesk SF
![Page 17: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/17.jpg)
![Page 18: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/18.jpg)
let’s get hacking
![Page 19: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/19.jpg)
good components in place early on
![Page 20: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/20.jpg)
...but were hosted on a single machine
somewhere in LA
![Page 21: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/21.jpg)
![Page 22: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/22.jpg)
less powerful than my MacBook Pro
![Page 23: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/23.jpg)
okay, we launched.now what?
![Page 24: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/24.jpg)
25k signups in the first day
![Page 25: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/25.jpg)
everything is on fire!
![Page 26: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/26.jpg)
best & worst day of our lives so far
![Page 27: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/27.jpg)
load was through the roof
![Page 28: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/28.jpg)
first culprit?
![Page 29: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/29.jpg)
![Page 30: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/30.jpg)
favicon.ico
![Page 31: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/31.jpg)
404-ing on Django, causing tons of errors
![Page 32: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/32.jpg)
lesson #1: don’t forget your favicon
![Page 33: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/33.jpg)
real lesson #1: most of your initial scaling
problems won’t be glamorous
![Page 34: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/34.jpg)
favicon
![Page 35: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/35.jpg)
ulimit -n
![Page 36: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/36.jpg)
memcached -t 4
![Page 37: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/37.jpg)
prefork/postfork
![Page 38: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/38.jpg)
friday rolls around
![Page 39: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/39.jpg)
not slowing down
![Page 40: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/40.jpg)
let’s move to EC2.
![Page 41: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/41.jpg)
![Page 42: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/42.jpg)
![Page 43: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/43.jpg)
scaling = replacing all components of a car
while driving it at 100mph
![Page 44: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/44.jpg)
since...
![Page 45: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/45.jpg)
“"canonical [architecture] of an early stage startup
in this era."(HighScalability.com)
![Page 46: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/46.jpg)
Nginx & Redis & Postgres & Django.
![Page 47: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/47.jpg)
Nginx & HAProxy & Redis & Memcached &Postgres & Gearman &Django.
![Page 48: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/48.jpg)
24h Ops
![Page 49: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/49.jpg)
![Page 50: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/50.jpg)
![Page 51: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/51.jpg)
our philosophy
![Page 52: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/52.jpg)
1 simplicity
![Page 53: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/53.jpg)
2 optimize for minimal operational
burden
![Page 54: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/54.jpg)
3 instrument everything
![Page 55: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/55.jpg)
walkthrough:1 scaling the database2 choosing technology3 staying nimble4 scaling for android
![Page 56: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/56.jpg)
1 scaling the db
![Page 57: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/57.jpg)
early days
![Page 58: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/58.jpg)
django ORM, postgresql
![Page 59: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/59.jpg)
why pg? postgis.
![Page 60: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/60.jpg)
moved db to its own machine
![Page 61: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/61.jpg)
but photos kept growing and growing...
![Page 62: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/62.jpg)
...and only 68GB of RAM on biggest machine in EC2
![Page 63: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/63.jpg)
so what now?
![Page 64: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/64.jpg)
vertical partitioning
![Page 65: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/65.jpg)
django db routers make it pretty easy
![Page 66: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/66.jpg)
def db_for_read(self, model): if app_label == 'photos': return 'photodb'
![Page 67: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/67.jpg)
...once you untangle all your foreign key
relationships
![Page 68: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/68.jpg)
a few months later...
![Page 69: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/69.jpg)
photosdb > 60GB
![Page 70: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/70.jpg)
what now?
![Page 71: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/71.jpg)
horizontal partitioning!
![Page 72: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/72.jpg)
aka: sharding
![Page 73: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/73.jpg)
“surely we’ll have hired someone experienced before we actually need
to shard”
![Page 74: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/74.jpg)
you don’t get to choose when scaling challenges
come up
![Page 75: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/75.jpg)
evaluated solutions
![Page 76: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/76.jpg)
at the time, none were up to task of being our
primary DB
![Page 77: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/77.jpg)
did in Postgres itself
![Page 78: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/78.jpg)
what’s painful about sharding?
![Page 79: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/79.jpg)
1 data retrieval
![Page 80: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/80.jpg)
hard to know what your primary access patterns will be w/out any usage
![Page 81: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/81.jpg)
in most cases, user ID
![Page 82: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/82.jpg)
2 what happens if one of your shards
gets too big?
![Page 83: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/83.jpg)
in range-based schemes (like MongoDB), you split
![Page 84: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/84.jpg)
A-H: shard0I-Z: shard1
![Page 85: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/85.jpg)
A-D: shard0E-H: shard2I-P: shard1Q-Z: shard2
![Page 86: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/86.jpg)
downsides (especially on EC2): disk IO
![Page 87: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/87.jpg)
instead, we pre-split
![Page 88: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/88.jpg)
many many many (thousands) of logical
shards
![Page 89: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/89.jpg)
that map to fewer physical ones
![Page 90: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/90.jpg)
// 8 logical shards on 2 machines
user_id % 8 = logical shard
logical shards -> physical shard map
{ 0: A, 1: A, 2: A, 3: A, 4: B, 5: B, 6: B, 7: B}
![Page 91: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/91.jpg)
// 8 logical shards on 2 4 machines
user_id % 8 = logical shard
logical shards -> physical shard map
{ 0: A, 1: A, 2: C, 3: C, 4: B, 5: B, 6: D, 7: D}
![Page 92: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/92.jpg)
little known but awesome PG feature: schemas
![Page 93: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/93.jpg)
not “columns” schema
![Page 94: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/94.jpg)
- database: - schema: - table: - columns
![Page 95: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/95.jpg)
machineA: shard0 photos_by_user shard1 photos_by_user shard2 photos_by_user shard3 photos_by_user
![Page 96: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/96.jpg)
machineA: shard0 photos_by_user shard1 photos_by_user shard2 photos_by_user shard3 photos_by_user
machineA’: shard0 photos_by_user shard1 photos_by_user shard2 photos_by_user shard3 photos_by_user
![Page 97: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/97.jpg)
machineA: shard0 photos_by_user shard1 photos_by_user shard2 photos_by_user shard3 photos_by_user
machineC: shard0 photos_by_user shard1 photos_by_user shard2 photos_by_user shard3 photos_by_user
![Page 98: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/98.jpg)
can do this as long as you have more logical shards than physical
ones
![Page 99: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/99.jpg)
lesson: take tech/tools you know and try first to adapt them into a simple
solution
![Page 100: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/100.jpg)
2 which tools where?
![Page 101: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/101.jpg)
where to cache / otherwise denormalize
data
![Page 102: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/102.jpg)
we <3 redis
![Page 103: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/103.jpg)
what happens when a user posts a photo?
![Page 104: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/104.jpg)
1 user uploads photo with (optional) caption
and location
![Page 105: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/105.jpg)
2 synchronous write to the media database for
that user
![Page 106: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/106.jpg)
3 queues!
![Page 107: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/107.jpg)
3a if geotagged, async worker POSTs to Solr
![Page 108: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/108.jpg)
3b follower delivery
![Page 109: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/109.jpg)
can’t have every user who loads her timeline
look up all their followers and then their photos
![Page 110: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/110.jpg)
instead, everyone gets their own list in Redis
![Page 111: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/111.jpg)
media ID is pushed onto a list for every person
who’s following this user
![Page 112: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/112.jpg)
Redis is awesome for this; rapid insert, rapid
subsets
![Page 113: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/113.jpg)
when time to render a feed, we take small # of IDs, go look up info in
memcached
![Page 114: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/114.jpg)
Redis is great for...
![Page 115: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/115.jpg)
data structures that are relatively bounded
![Page 116: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/116.jpg)
(don’t tie yourself to a solution where your in-
memory DB is your main data store)
![Page 117: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/117.jpg)
caching complex objects where you want to more
than GET
![Page 118: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/118.jpg)
ex: counting, sub-ranges, testing membership
![Page 119: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/119.jpg)
especially when Taylor Swift posts live from the
CMAs
![Page 120: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/120.jpg)
follow graph
![Page 121: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/121.jpg)
v1: simple DB table(source_id, target_id,
status)
![Page 122: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/122.jpg)
who do I follow?who follows me?
do I follow X?does X follow me?
![Page 123: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/123.jpg)
DB was busy, so we started storing parallel
version in Redis
![Page 124: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/124.jpg)
follow_all(300 item list)
![Page 125: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/125.jpg)
inconsistency
![Page 126: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/126.jpg)
extra logic
![Page 127: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/127.jpg)
so much extra logic
![Page 128: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/128.jpg)
exposing your support team to the idea of cache invalidation
![Page 129: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/129.jpg)
![Page 130: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/130.jpg)
redesign took a page from twitter’s book
![Page 131: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/131.jpg)
PG can handle tens of thousands of requests, very light memcached
caching
![Page 132: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/132.jpg)
two takeaways
![Page 133: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/133.jpg)
1 have a versatile complement to your core data storage (like Redis)
![Page 134: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/134.jpg)
2 try not to have two tools trying to do the
same job
![Page 135: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/135.jpg)
3 staying nimble
![Page 136: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/136.jpg)
2010: 2 engineers
![Page 137: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/137.jpg)
2011: 3 engineers
![Page 138: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/138.jpg)
2012: 5 engineers
![Page 139: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/139.jpg)
scarcity -> focus
![Page 140: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/140.jpg)
engineer solutions that you’re not constantly returning to because
they broke
![Page 141: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/141.jpg)
1 extensive unit-tests and functional tests
![Page 142: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/142.jpg)
2 keep it DRY
![Page 143: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/143.jpg)
3 loose coupling using notifications / signals
![Page 144: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/144.jpg)
4 do most of our work in Python, drop to C when
necessary
![Page 145: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/145.jpg)
5 frequent code reviews, pull requests to keep things in the ‘shared
brain’
![Page 146: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/146.jpg)
6 extensive monitoring
![Page 147: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/147.jpg)
munin
![Page 148: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/148.jpg)
statsd
![Page 149: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/149.jpg)
![Page 150: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/150.jpg)
“how is the system right now?”
![Page 151: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/151.jpg)
“how does this compare to historical trends?”
![Page 152: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/152.jpg)
scaling for android
![Page 153: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/153.jpg)
1 million new users in 12 hours
![Page 154: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/154.jpg)
great tools that enable easy read scalability
![Page 155: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/155.jpg)
redis: slaveof <host> <port>
![Page 156: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/156.jpg)
our Redis framework assumes 0+ readslaves
![Page 157: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/157.jpg)
tight iteration loops
![Page 158: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/158.jpg)
statsd & pgfouine
![Page 159: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/159.jpg)
know where you can shed load if needed
![Page 160: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/160.jpg)
(e.g. shorter feeds)
![Page 161: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/161.jpg)
if you’re tempted to reinvent the wheel...
![Page 162: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/162.jpg)
don’t.
![Page 163: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/163.jpg)
“our app servers sometimes kernel panic
under load”
![Page 164: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/164.jpg)
...
![Page 165: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/165.jpg)
“what if we write a monitoring daemon...”
![Page 166: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/166.jpg)
wait! this is exactly what HAProxy is great at
![Page 167: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/167.jpg)
surround yourself with awesome advisors
![Page 168: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/168.jpg)
culture of openness around engineering
![Page 169: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/169.jpg)
give back; e.g. node2dm
![Page 170: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/170.jpg)
focus on making what you have better
![Page 171: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/171.jpg)
“fast, beautiful photo sharing”
![Page 172: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/172.jpg)
“can we make all of our requests 50% the time?”
![Page 173: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/173.jpg)
staying nimble = remind yourself of what’s
important
![Page 174: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/174.jpg)
your users around the world don’t care that you
wrote your own DB
![Page 175: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/175.jpg)
wrapping up
![Page 176: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/176.jpg)
unprecedented times
![Page 177: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/177.jpg)
2 backend engineers can scale a system to
30+ million users
![Page 178: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/178.jpg)
key word = simplicity
![Page 179: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/179.jpg)
cleanest solution with the fewest moving parts as
possible
![Page 180: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/180.jpg)
don’t over-optimize or expect to know ahead of time how site will scale
![Page 181: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/181.jpg)
don’t think “someone else will join & take care
of this”
![Page 182: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/182.jpg)
will happen sooner than you think; surround yourself with great
advisors
![Page 183: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/183.jpg)
when adding software to stack: only if you have to, optimizing for operational
simplicity
![Page 184: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/184.jpg)
few, if any, unsolvable scaling challenges for a
social startup
![Page 185: Mike Krieger, Instagram at the Airbnb tech talk, on Scaling Instagram](https://reader034.vdocument.in/reader034/viewer/2022051512/54491b87b1af9f57618b4ea2/html5/thumbnails/185.jpg)
have fun