99
Everything’s Harder at Scale Marty Weiner CTO, Reddit u/Mart2D2 @MartyWeiner

Startupfest 2016: MARTY WEINER (Reddit) - How to

Embed Size (px)

Citation preview

Everything’s Harder at Scale

Marty WeinerCTO, Redditu/Mart2D2@MartyWeiner

Building a Startup is Hard

• Reduce the pain of the first 18 months of scalability hell• Look at how a company scales technically and culturally from idea to BIG

at major inflection points• Strategies for thinking about technology and culture• Construct a tech stack recipe you can use

Goals

Goals

• Focus is on engineering• For those who have not experienced small -> BIG• Scope is from idea to solid traction and about 100 employees• Every startup is different, but in many ways they’re the same• Lots in this talk, will put slides up• I’m not being paid by any vendors!

Inflection Points

LaunchDeveloping the IdeaTrickle :(

TRAAAACTION!

Becoming a Business

Let’s make a fictional startup!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Idea bubbling around in founder’s head• Work on it in spare time• Doodle in class / at work / in dorm / at coffee shop

Day -100 · Idea Forming

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Here’s the idea for our startup:• It’s a social network• Topics organized by community• You can send messages• Max of 140 characters• They’re deleted in 10 seconds after viewing• Pin your interests• And you can order a taxi…

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• It’s called SnapinUberTweetySnoo• snapinubertweetysnoo.com taken :(

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Settle on “Salad Rabbit”• saladrabbit.com was the least bad idea for a URL that’s available

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• No serious competition, or at least you totally can do better!• You (or you and engy buddy) start mocking up an app

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Much Ramen later, you slapped together an iPhone app and servers• Friends and family using it• Get some YC money• You set up Google Analytics and add a few extras like push notifications

Day -30 · Demo!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• You officially launch!• It’s on the App Store!!!!!

Day 0 · Launch!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Sit there refreshing Google Analytics over and over and over and over…..

Day 0 · Launch!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Nobody coming. Well, ok, a few..

Day 10 · Waiting

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Developing the idea and the tech stack. Added some features.• A few people are coming. At least they’re very passionate• Is anything going to happen?

Day 11 to 119 · A trickle

• Is this working?• Should… should I pivot??

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Day 11 to 119 · A trickle

Not supposed to be stealth mode :(

Pinterest Page Views / Day

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Not really sure why, but users start pouring in• Featured in Apple’s Best New Apps with “Salad” in the Title• Hijacked the jumbotron at the Superbowl

• Hopefully this is not a fluke

Day 120 · Something’s happening ?!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Users still pouring in!• You’re running out to talk to VCs• Trying to hire engineers. They’re junior or hackers.• Your tech is a confusing blob of shiny new technologies• Site now timing out consistently. Brace yourself, it’s gonna be a tough 12+

months of scalability hell.

Day 140 · Traaaaaction!

Let’s go back in time…

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Founder starts digging deeper• Goal should be, above all, on getting a Minimal Viable Product out there for

people to see

Day -90 · Fleshing it out

• Hypothesis is “People will like what I’m building”

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Day -90 · Fleshing it out

Maximize for Velocity, Agility, Creativity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Choose one frontend platform: iPhone, Android, Web

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Choose one frontend platform: iPhone, Android, Web• You’ll need a backend to store data, facilitate communications, etc

• Maximizes velocity, agility, creativity• One we can evolve with the number of employees and users

• Let’s construct a recipe you can use

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Tons of choice for tech. Databases alone:• Postgres• Redis• Cassandra• HBase• Riak• Neo4j

Tech Maturity

• CouchDB• Membase• MySQL• MongoDB• VoltDB• … hundred others

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• “We’re building the latest and greatest. I need the latest and greatest.”• No no no no no no… no… no

• “This tech magically scales for you”• Until it doesn’t…

• “It’s shiny and new. It must be faster or betterer”• Stop

Tech Maturity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Tech Maturity

Maturity =Blood + Sweat

Complexity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Redis

Maturity =Blood + Sweat

Complexity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

HBase

Maturity =Blood + Sweat

Complexity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

MySQL

Maturity =Blood + Sweat

Complexity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Sometimes you must use immature tech, but…• Harder to hire• Harder to get help (yes, all tech has problems at some point)• Stability and performance uncertain, especially at larger scale• Debugging will be harder• Tools weaker

• If biggest user, challenges greatly amplified• Most likely you won’t *really* need immature tech for a long time

Tech Maturity

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Use Amazon Web Services (AWS) for hosting• Evolves and scales with you from tiny to BIG• Competitively priced• Lots of tools to help get you moving (DBs, cache, search, email, DNS, CDN, …)

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Use AWS Route53 to register your domain (saladrabbit.com)

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Spin up a tiny EC2 instance for your first API (or web) server• Describes outside interfaces and contains product logic• Use latest Ubuntu• Nginx to serve HTTP• Use Python / Flask / pymysql or Python / Django for backend code• Use Route53 to connect your domain to your tiny instance

• Using api.saladrabbit.com• Your EC2 instance storage is EBS (Easy backups!)• Call it something descriptive like api001

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Create an S3 bucket for serving static assets (js, css, images)• S3 is super durable, very available storage

• Use Route53 to connect a subdomain to it (e.g, assets.saladrabbit.com)

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Use git + Github for your version control• Get code backup for free!• Good for code reviews, bug reporting when you’re ready for it• Makes deployment easier

Day -90 · Fleshing it out

AWS API

Route53

S3

api.assets.

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Need a place to store user info, content, follower graphs, etc• We need a database

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Just use MySQL• The boring tech revolution is here• Use AWS Relational Database Service (RDS) to manage it (Tiny instance size)

• Conveniently manages MySQL instances• Costs ~1.5x• RDS -> self managed MySQL migration is easy• Don’t have to worry about database operations for early days!

• No configs to understand• Backups done for you• No messing with failovers (even has automatic failover)

• Don’t be afraid of joins, distinct, count, etc!

Day -90 · Fleshing it out

AWS API

Route53

S3

api.assets.

RDS

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• How does your API box know the RDS endpoint?• Just use simple python config files (no haproxy layers, no zookeeper, …)

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Make your backend easy to debug• Use Python logging to syslog (AWS CloudWatch looks like an interesting option)

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Search• Use AWS CloudSearch

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• That’s probably it• Don’t need to send notifications, emails, etc unless they’re vital to your demo• Don’t optimize anything on the backend unless you have to

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• So far…• We have an app• Architecture that doesn’t limit your velocity, agility, creativity• Won’t scale far, but we can evolve and grow it• Now go show people!

Day -90 · Fleshing it out

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Show it to friends, family, r/entrepreneur, people on the train• Hopefully people love it! Though they’ll hate the name…• Take feedback, thank people for it, ignore the naysayers

Day -30 · Demo!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Focus on last critical product needs• Tighten up the frontend experience• Add asynchronous background processing

• For sending email, sharing to Facebook / Twitter, processing images, etc…• Use PinLater for background processing• Push Notifs (AWS SNS), SMS (Twilio), Email (AWS SES)

• Add Google Analytics to frontend

Day -29 to -1 · Prep for Launch

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Tell everybody!• Connect to Google Analytics and hit refresh over and over again

Day 0 · Laaaaunch!

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Stay focused on product (no need to sacrifice velocity, agility, creativity)• Round out product and operations

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• If necessary, add other platforms

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Add StatsD to measure timings and counts live (only use _upper* timings!)

Day 1 to 119 · A Trickle

* Long story, see appendix

statsd_connection.incr(“event.user_signup”) statsd_connection.timing(“event.mysql_queries.get_user_feed”, time_ms)

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Add StatsD timings to all interface points• All API endpoints• All MySQL calls• All calls to other services• All background tasks

• Make a dashboard

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Make it faster to launch / config boxes with IT Automation• Puppet, Chef (AWS OpsWorks)

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Set up CloudWatch or Pingdom to notify of downtime• Will save you sleep

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Add more API servers• Use AWS ELB to distribute load• Make it fast to bring one API server up

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Set up development and staging environments• Make Route53 connections (e.g., martydev.saladrabbit.com)

• Make it easy to deploy new code to production or staging• Use Teletraan

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• So far…• iPhone app talking to your API + logic servers through Route53 and ELB• Database (MySQL)• Static storage (S3)• Search (Cloudwatch), Virality, Background Task Processing (PinLater)• Visibility (Google Analytics, Statsd, AWS CloudWatch)• Deployability (staging, dev, Teletraan, AWS OpsWorks)

Day 1 to 119 · A Trickle

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Ok, people coming. Whoa.

Day 120 · Something Happening

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Not a fluke… even more are coming. Winter is here.

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Site begins to timeout or queues start backing up• Profile first! (Check StatsD)• Probably your poor database (will bet money)

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• NOW begin to trade off velocity, agility, creativity for site availability• Don’t worry, we’ll get them back

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• If it is your database that’s causing problems…• Start increasing instance sizes (Add RAM and especially go to SSD)

• Short downtime in RDS• Begin optimizing your queries and reducing load on MySQL

• Check slowlog and profile (SHOW FULL PROCESSLIST) for worst queries• Add indexes• Start caching• Start normalizing all queries and remove joins, distincts, etc

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Caching• Create Memcache or Redis servers behind McRouter or use Elasticache• Check cache -> go to db -> put back in cache• Hunt for common queries you can cache

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Normalize your data• Object tables are only used for ID -> data lookups

• e.g., users table (noun)• Add primary key + auto_increment on ID (this generates IDs for you!)

• Mapping tables are only used for From ID -> To ID lookups• e.g., users_said_comments (noun_activeverb_noun)• Add sequence column if you need order and your ID does not support order• Add indexes: Unique on From,To and Index on To

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Normalize

SELECT text FROM comments WHERE user_id=%(user_id)s

SELECT comment_id FROM users_said_comments WHERE user_id=%s

SELECT text FROM comments WHERE id IN %(comment_ids)s

SELECT text FROM comments WHERE listing_id=%(listing_id)s

SELECT comment_id FROM listing_contains_comments WHERE listing_id=%s

SELECT text FROM comments WHERE id IN %(comment_ids)s

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Normalize

SELECT text FROM comments WHERE user_id=%(user_id)s

SELECT comment_id FROM users_said_comments WHERE user_id=%s

SELECT text FROM comments WHERE id IN %(comment_ids)s

SELECT text FROM comments WHERE listing_id=%(listing_id)s

SELECT comment_id FROM listing_contains_comments WHERE listing_id=%s

SELECT text FROM comments WHERE id IN %(comment_ids)s

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Optimizing Feeds

SELECT text FROM comments LEFT JOIN followers ON comments.user_id=followers.followee_id WHERE followers.follower_id=%(user_id)s ORDER BY create_date DESC OFFSET 0,20

SELECT followee_id FROM users_followed_by_users WHERE follower_id=%(user_id)s

SELECT comment_id FROM users_said_comments WHERE user_id IN %(followee_ids)s ORDER BY sequence DESC OFFSET 0,20

SELECT text FROM comments WHERE id IN %(comment_ids)s

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Optimizing FeedsSELECT followee_id FROM users_followed_by_users WHERE follower_id=%(user_id)s

SELECT comment_id FROM users_said_comments WHERE user_id IN %(followee_ids)s ORDER BY sequence DESC OFFSET 0,20

SELECT text FROM comments WHERE id IN %(comment_ids)s

[Aync after comment]

SELECT follower_id FROM users_followed_by_users WHERE followee_id=%(user_id)s

Put Comment in Redis follower_to_comments

[On Read]

comment_ids = redis_get_follower_to_comments(user_id)

SELECT text FROM comments WHERE id IN %(comment_ids)s

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Optimizing FeedsSELECT followee_id FROM users_followed_by_users WHERE follower_id=%(user_id)s

SELECT comment_id FROM users_said_comments WHERE user_id IN %(followee_ids)s ORDER BY sequence DESC OFFSET 0,20

SELECT text FROM comments WHERE id IN %(comment_ids)s

[Aync after comment]

SELECT follower_id FROM users_followed_by_users WHERE followee_id=%(user_id)s

Put Comment in Redis follower_to_comments

[On Read]

comment_ids = get_follower_to_comments(user_id)

SELECT text FROM comments WHERE id IN %(comment_ids)s

Push Model (use me)

Pull Model

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• MySQL doesn’t magically scale out of the box• When to Shard?

• Increased instance sizes to big SSD servers• And you’ve moved as many tables to other instances as possible• And you are reading from read slaves

• How to Shard?• Click here or Google for “Sharding Pinterest”• Google for “Sharding & IDs at Instagram”

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Logging data and operations• Log all page views (and some info on what was seen)• Log all major events (create, update, delete, click offsite, etc)• Eventually log all service calls

• Why?• Will save your butt some day (when you bork your database)• Beginning of really understanding your users and growth

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Use Kafka and Secor to get events from backend into AWS S3• Use AWS EMR to start digging into data• Pinball or AWS SWF help you run queries automatically• Transcode MySQL backups nighty into S3 so EMR can use them• Near future: data science, A/B experiments• Not yet: machine learning

Day 140 · Traction

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Getting good at operations• Scale (more) under control• Have data and some goals + metrics• Growing company size (10+)• Foosball table

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• New Eng Goal: Build The Dream Machinetm

• Team and tech that can build any idea faster and better with each year• Tech even drives creativity• Start to regain velocity, agility, and creativity

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• You’ve probably built up some tech debt and have a nasty monolithic codebase• R2 (Reddit), Pinboard (Pinterest), Obidos (Amazon)

• Begin to pay down tech debt• Align teams for success• Move to a service oriented architecture

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Engineering management• Don’t “promote” best engineer to manager

• Lose best coder / doer, made a First Time Manager (FTM)• Do have discussions with engineers about their careers• Management should not be a promotion

• Give engies and managers equal path to impact and comp• Engineers who have never managed should not step in lightly

• Give 6 month path

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Technically Strong Jerk (TSJ)• Appear at many companies at 10+ employees• 2x faster than others, maybe leading an important initiative

• … but make life hell for everybody else (1x -> .5x)

1 tst x 2 strength + 9 engineers x .5 strength = 6.5 effort0 tst x 2 strength + 9 engineers x 1 strength = 9.0 effort

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Motivation = ?

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

Motivation = Autonomy + Mastery + Purpose- Daniel Pink

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Services, assets, and libraries• Components that help product ideas materialize faster and better• Marry your tech and culture

• Focus teams on identifying their customer and making them happy• Task them with building the best solution in the world. Go!• Predictable timelines and behavior => Trust

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• A good service, asset, library…• Is easy to start using• Helps anybody in the company develop their ideas faster and better• Is useful in many contexts• Is consistently available with consistent latency at appropriate scales• Enforces boundaries (e.g., interface to credit card data)• Is scalable• Is coded cleanly, encourages testing• Supplies super easy monitoring, debugging, and alerting• Think: Legos

Month 12+ · Build Your Business

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• A great service, asset, library…• Drives creativity• Think: Legos

Month 12+ · Build Your Business

Unity Asset Store

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Build a good service framework• Look at Reddit’s Baseplate• Use Thrift for communication• Use ZooKeeper for service discovery

• Build an asset store

Month 12+ · Build Your Business

AWSAPI

Route53, ELB

S3

api.assets.

MySQL

CloudFrontWeb

ZooKeeper, Thrift

Data Services

Redis Memcache

Search Email PinLater

Kafka

S3

SparkSecor

EMR

OtherServices

Arch

MySQL

Data Services

Redis Memcache

Search Email

PinLater Kafka

S3

Spark

Secor

EMR

PlatformEng

Product Eng

Web, M Web

Android Native

iOS Native

Frontend Frameworks Backend Services

Growth Monetization Your Strategic Pillars

Org Structure

API

ELB

Route 53

Feeds

ML Terrapin

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• Salad Rabbit able to prototype and ship great ideas quickly• High functioning creative team that can focus on hard problems• Able to try experiments on massive audiences• Hiring the best people in the world• Able to change the world for the better

Now

Turns out, many things do get better with scale…

Q&AAsk Me Anything

Marty WeinerCTO, Redditu/Mart2D2@MartyWeiner

Appendix

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• For researching EC2 instance types, http://ec2instances.info is the best place ever• For managing Redis, here’s a tip

Useful Tidbits

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• StatsD has several percentile options for showing your timing data• upper{50,95,99}, upper, lower{50,95,99}, lower, mean{50,95,99}, mean• upper means highest timing, upper99 means the 99%ile timing

• Can be confusing because I would think upper99 would mean lowest 1%…• I don’t know why you would use mean{50,95,99}

• Makes no statistical sense (am I missing something?)

Tidbits about StatsD

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• StatsD has several percentile options for showing your timing data• These timings measure the percentile over a few seconds

• No reason to not just go with the max (upper), since it’s over just a few seconds

• You can aggregate max’s to get other percentiles over longer time periods• E.g., 95%ile of latency over 1 day

• You cannot (statistically) aggregate anything but max (95%ile of 95%ile is nonsensical)

• I don’t know why you would ever want lower percentiles• At least not for latency…• Does not tell you how good you can be

Tidbits about StatsD

Idea Forming

Fleshing It Out Demo! Launch! Trickle :(

Something’s Happening ?! TRAAAACTION!

Becoming a Business

• May get stuck at 80 employees for a surprisingly long time• Not sure anybody understands why this happens…

• Cultures usually struggle at 80 to 120 employees• Communications break down => Loss of trust• Goals might be unclear• Comp / HR discussions beginning• Some startup folks not comfortable• Management decisions must be made (can cause tension)

• Things often smoother at 140 employees• Things tough again at 200• …

Growth tidbits