Top Banner
34

Startup Showcase - QuizUp

Jan 27, 2017

Download

Business

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Startup Showcase - QuizUp
Page 2: Startup Showcase - QuizUp

* as CodeÁrni Birgisson

Infrastructure Engineer @arnibirgisson

Page 3: Startup Showcase - QuizUp

What is QuizUp?

Page 4: Startup Showcase - QuizUp

What is QuizUp?

• The biggest trivia game in the world!

• Record setting 1M in first week

• 1000+ curated topics in 6 languages

• MyQuizUp topics

• Millions of questions

Page 5: Startup Showcase - QuizUp

QuizUp

Infrastructure

Page 6: Startup Showcase - QuizUp

• QuizUp-Admin

• Codebase python

• Created AMI’s along

with ASG, ELB AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]{ASG

ELB

Datastores

Page 7: Startup Showcase - QuizUp

• Multiple services

• AMI + ASG per service

• ELB for service-to-

serviceAMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]{ASG

ELB

AMI #2

[Java App]

ELB

AMI #2

[Java App]AMI #2

[Java App]

Datastores

Page 8: Startup Showcase - QuizUp

• Increasing number of services

• SOA / Micro Service architecture

• Routers (nginx)

• ZooKeeper

• ZooRunnerAMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI#1

[Python App]

ASG

Routers

AMI #2

[Java App]AMI #2

[Java App]AMI #2

[Java App]

Datastores

RoutersRoutersRouters

AMI #2

[Java App]{ AMI #2

[Java App]AMI #3

[Java App]

Page 9: Startup Showcase - QuizUp

• Docker

• Python, Node, Go, Java, Scala,

C++

• More generic AMIs

AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Docker App]

ASG

Routers

AMI #2

[Java App]AMI #2

[Java App]AMI #2

[Docker App]

Datastores

RoutersRoutersRouters

AMI #2

[Java App]{ AMI #2

[Java App]AMI #3

[Docker App]

Page 10: Startup Showcase - QuizUp

• ~50 different services

• Mostly JVM

• All services run in docker

• Single AMI

• Datastores too*AMI

[Python App]AMI

[Python App]AMI

[Python App]AMI

[Python App]

Single AMI

[App]

[Dependancies]

ASG

Routers

AMI #2

[Java App]AMI #2

[Java App]

Single AMI

[App]

[Dependancies]

Datastores

RoutersRoutersRouters

AMI #2

[Java App]

{

AMI #2

[Java App]

Single AMI

[App]

[Dependancies]

… x 50

Page 11: Startup Showcase - QuizUp

Why IaC?

Page 12: Startup Showcase - QuizUp

Why IaC?• EC2 Classic - VPC

• QuizUp-Admin outdated

• Increasing complexity

• Iteration speed

• Clean setup, not a VPC version of the old

stuff.

Page 13: Startup Showcase - QuizUp

Experiments

Page 14: Startup Showcase - QuizUp

Experiments

• CloudFormation, Troposphere, Terraform

• VPC with one service

Page 15: Startup Showcase - QuizUp

Experiments• VPC

• Subnets

• Routing Table

• Auto-Scale Group

• Launch Configuration

• Security Group (+ rules)

• Support for variables

Page 16: Startup Showcase - QuizUp

Experiments

• Decided to use Terraform

• Plan / Apply (preview changes)

• Why is that important?

Page 17: Startup Showcase - QuizUp

Infrastructure as Code

Page 18: Startup Showcase - QuizUp

What’s Included

• Repository

• Terraform

• CI

• Module for a Service

• Modules for DynamoDB, ELBs, etc.

Page 19: Startup Showcase - QuizUp
Page 20: Startup Showcase - QuizUp

deploy

staging

iterate

Test

deploy

production

PR/Revie

w

merge

CI JOB checks syntax and

outputs plan

Branch with

proposed change

Iteration

Page 21: Startup Showcase - QuizUp

Single AMI

• Can become any service

• Packer + Puppet

• QuizUp Docker Manager

• Logging & Metrics

Page 22: Startup Showcase - QuizUp

Single AMI

Quizup Docker Manager

statsd log shipper

Instance metadata ZooKeeper

application dependancy dependancy

Docker registry

Page 23: Startup Showcase - QuizUp

Configuration as Code

Page 24: Startup Showcase - QuizUp

Configuration

• Servers fetch config from ZooKeeper

• ZooKeeper manually updated

• Can we use a similar flow?

Page 25: Startup Showcase - QuizUp

Yes!

• In house git repository

• git/filesystem to ZooKeeper sync tool

• Jenkins CI

• Configuration through same workflow

Branches, PR

Page 26: Startup Showcase - QuizUp

What have we gained?

Page 27: Startup Showcase - QuizUp

What have we gained?• Production infrastructure changes worry-

free non-events

• Code = Documentation

• Peer reviews, PRs, Comments

• Disaster recovery

• History (+ reverting!)

Page 28: Startup Showcase - QuizUp

What have we gained?

• Anyone can propose infrastructure changes

• Faster and more consistent changes

• Staging is a small copy of production

Page 29: Startup Showcase - QuizUp

What have we gained?

Infrastructure as Code

helps maintain a devops culture

by using the same workflow

to modify applications, infrastructure and

configuration

Page 30: Startup Showcase - QuizUp

What’s not great?

Page 31: Startup Showcase - QuizUp

State

• State file must be kept safe!

• Hard to “inject” resources into state

• (Currently) no way to create Terraform

description of current resources

Page 32: Startup Showcase - QuizUp

Speed

• Must choose between:

• Apply everything always (slower)

Infrastructure = Code

• Apply in parts (speedy)

Requires plumbing. Can diverge.

Page 33: Startup Showcase - QuizUp

No sidelining

• No manual changes

• They are reset during next apply

• Pro or Con ?

Page 34: Startup Showcase - QuizUp

Thank You