217
Building a Massively Scalable Cloud Service from the Grounds Up

Building a Massively Scalable Cloud Service from the Grounds Up

  • View
    560

  • Download
    3

Embed Size (px)

DESCRIPTION

Serving developer binaries isn’t trivial. Such binaries are consumed by tools ,and create massive request load. Add to that support for metadata, REST API, storage quotas, stats, repo indexes on demand and global HA distribution, and you’ve got yourself a pretty complicated system to run and manage. This talk will show you how Bintray, JFrog’s social binary distribution service, works. We will speak about how the system segmentation supports massive loads across data centers with stateless vertical scaling; how Grails applications scale and how we tie up different NoSQL technologies such as CouchDB, MongoDB, ElasticSearch & Redis; how we chose between physical and virtual servers and how we manage deployments without service interruption.

Citation preview

Page 1: Building a Massively Scalable Cloud Service from the Grounds Up

Building a Massively Scalable Cloud Service

from the Grounds Up

Page 2: Building a Massively Scalable Cloud Service from the Grounds Up

Yoav Landman

@yoavlandman

github.com/yoav

cee tee oh @ JFrog

Page 3: Building a Massively Scalable Cloud Service from the Grounds Up

What Frog?

Page 4: Building a Massively Scalable Cloud Service from the Grounds Up

What Frog?

Page 5: Building a Massively Scalable Cloud Service from the Grounds Up

What Frog?

Page 6: Building a Massively Scalable Cloud Service from the Grounds Up

What Frog?

Page 7: Building a Massively Scalable Cloud Service from the Grounds Up

So…

Page 8: Building a Massively Scalable Cloud Service from the Grounds Up

Some Numbers ___________ liftoff + 5 months

Page 9: Building a Massively Scalable Cloud Service from the Grounds Up

Some Numbers ___________ liftoff + 5 months

Users 7K

Page 10: Building a Massively Scalable Cloud Service from the Grounds Up

Some Numbers ___________ liftoff + 5 months

Users 7K

Packages 70K

Page 11: Building a Massively Scalable Cloud Service from the Grounds Up

Some Numbers ___________ liftoff + 5 months

Users 7K

Packages 70K

Requests 1.2 B/Month

Page 12: Building a Massively Scalable Cloud Service from the Grounds Up
Page 13: Building a Massively Scalable Cloud Service from the Grounds Up
Page 14: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements ___________

Page 15: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Download binaries

___________

Page 16: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Download binaries – Web Front

___________

Page 17: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Download binaries – Web FRONT – REST API

___________

Page 18: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Download binaries – Web FRONt – REST API – Backend services

___________

Page 19: Building a Massively Scalable Cloud Service from the Grounds Up

We know developers

Page 20: Building a Massively Scalable Cloud Service from the Grounds Up

%new_sexy_lang% community

Page 21: Building a Massively Scalable Cloud Service from the Grounds Up

Not our fault! AWS failed again!

Page 22: Building a Massively Scalable Cloud Service from the Grounds Up

Downloads must…

Page 23: Building a Massively Scalable Cloud Service from the Grounds Up

Web application must…

Page 24: Building a Massively Scalable Cloud Service from the Grounds Up

Backend Services must…

Page 25: Building a Massively Scalable Cloud Service from the Grounds Up

Choose your battles...

Page 26: Building a Massively Scalable Cloud Service from the Grounds Up

Non-Func. Requirements _________________

Page 27: Building a Massively Scalable Cloud Service from the Grounds Up

Non-Func. Requirements

Requirement RPS Availability

_________________

Page 28: Building a Massively Scalable Cloud Service from the Grounds Up

Non-Func. Requirements

Requirement RPS Availability

Download 10K Always

_________________

Page 29: Building a Massively Scalable Cloud Service from the Grounds Up

Non-Func. Requirements

Requirement RPS Availability

Download 10K Always

Interaction 200 Almost always

_________________

Page 30: Building a Massively Scalable Cloud Service from the Grounds Up

Non-Func. Requirements

Requirement RPS Availability

Download 10K Always

Interaction 200 Almost always

Services 10 Most of the time

_________________

Page 31: Building a Massively Scalable Cloud Service from the Grounds Up

Download Server

Page 32: Building a Massively Scalable Cloud Service from the Grounds Up
Page 33: Building a Massively Scalable Cloud Service from the Grounds Up

No Servlets here

Page 34: Building a Massively Scalable Cloud Service from the Grounds Up
Page 35: Building a Massively Scalable Cloud Service from the Grounds Up
Page 36: Building a Massively Scalable Cloud Service from the Grounds Up
Page 37: Building a Massively Scalable Cloud Service from the Grounds Up
Page 38: Building a Massively Scalable Cloud Service from the Grounds Up
Page 39: Building a Massively Scalable Cloud Service from the Grounds Up
Page 40: Building a Massively Scalable Cloud Service from the Grounds Up
Page 41: Building a Massively Scalable Cloud Service from the Grounds Up
Page 42: Building a Massively Scalable Cloud Service from the Grounds Up

Deduplication by Checksum

File  A:  46b34  

File  B:  a64ff7  

/user-­‐a/repo-­‐z/package-­‐y/file-­‐x  

/org-­‐c/repo-­‐m/package-­‐n/file-­‐k  

/user-­‐m/repo-­‐w/package-­‐t/file-­‐f  

Page 43: Building a Massively Scalable Cloud Service from the Grounds Up

Flat blobs storage

File  A:  46b34  

File  B:  a64ff7  

Page 44: Building a Massively Scalable Cloud Service from the Grounds Up
Page 45: Building a Massively Scalable Cloud Service from the Grounds Up
Page 46: Building a Massively Scalable Cloud Service from the Grounds Up
Page 47: Building a Massively Scalable Cloud Service from the Grounds Up
Page 48: Building a Massively Scalable Cloud Service from the Grounds Up

Mapping

/user-­‐m/repo-­‐w/package-­‐t/file-­‐f  

Page 49: Building a Massively Scalable Cloud Service from the Grounds Up
Page 50: Building a Massively Scalable Cloud Service from the Grounds Up
Page 51: Building a Massively Scalable Cloud Service from the Grounds Up
Page 52: Building a Massively Scalable Cloud Service from the Grounds Up

Web Front

Page 53: Building a Massively Scalable Cloud Service from the Grounds Up
Page 54: Building a Massively Scalable Cloud Service from the Grounds Up
Page 55: Building a Massively Scalable Cloud Service from the Grounds Up
Page 56: Building a Massively Scalable Cloud Service from the Grounds Up
Page 57: Building a Massively Scalable Cloud Service from the Grounds Up
Page 58: Building a Massively Scalable Cloud Service from the Grounds Up
Page 59: Building a Massively Scalable Cloud Service from the Grounds Up

Web Front

Web Framework

Page 60: Building a Massively Scalable Cloud Service from the Grounds Up
Page 61: Building a Massively Scalable Cloud Service from the Grounds Up
Page 62: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements ___________

Page 63: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Rapid Application Development

___________

Page 64: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Rapid Application Development – Flexible schema

___________

Page 65: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Rapid Application Development – Flexible schema – Java Background

___________

Page 66: Building a Massively Scalable Cloud Service from the Grounds Up

Requirements

– Rapid Application Development – Flexible schema – Java Background – Stateless

___________

Page 67: Building a Massively Scalable Cloud Service from the Grounds Up
Page 68: Building a Massively Scalable Cloud Service from the Grounds Up

Why don’t you just use...?

Framework Why not?

________________

Page 69: Building a Massively Scalable Cloud Service from the Grounds Up

Why don’t you just use...?

Framework Why not?

Angular.js Ember.js æж.js Maturity

________________

-  

Page 70: Building a Massively Scalable Cloud Service from the Grounds Up

Why don’t you just use...?

Framework Why not?

Angular.js Ember.js æж.js Maturity

Wicket State

________________

-  

Page 71: Building a Massively Scalable Cloud Service from the Grounds Up

Why don’t you just use...?

Framework Why not?

Angular.js Ember.js æж.js Maturity

Wicket State

JSF Model

________________

-  

Page 72: Building a Massively Scalable Cloud Service from the Grounds Up

Why don’t you just use...?

Framework Why not?

Angular.js Ember.js æж.js Maturity

Wicket State

JSF Model

Non-java No java bg

________________

-  

Page 73: Building a Massively Scalable Cloud Service from the Grounds Up
Page 74: Building a Massively Scalable Cloud Service from the Grounds Up
Page 75: Building a Massively Scalable Cloud Service from the Grounds Up
Page 76: Building a Massively Scalable Cloud Service from the Grounds Up
Page 77: Building a Massively Scalable Cloud Service from the Grounds Up
Page 78: Building a Massively Scalable Cloud Service from the Grounds Up
Page 79: Building a Massively Scalable Cloud Service from the Grounds Up

Updated Grails to newer minor

Page 80: Building a Massively Scalable Cloud Service from the Grounds Up
Page 81: Building a Massively Scalable Cloud Service from the Grounds Up

Web Front

Data Model

Page 82: Building a Massively Scalable Cloud Service from the Grounds Up
Page 83: Building a Massively Scalable Cloud Service from the Grounds Up

Remember?

Page 84: Building a Massively Scalable Cloud Service from the Grounds Up
Page 85: Building a Massively Scalable Cloud Service from the Grounds Up
Page 86: Building a Massively Scalable Cloud Service from the Grounds Up
Page 87: Building a Massively Scalable Cloud Service from the Grounds Up
Page 88: Building a Massively Scalable Cloud Service from the Grounds Up

Grails means Gorm!

Page 89: Building a Massively Scalable Cloud Service from the Grounds Up

Gorm MongoDB plugin

Page 90: Building a Massively Scalable Cloud Service from the Grounds Up

Web Front

Search

Page 91: Building a Massively Scalable Cloud Service from the Grounds Up

Search

Page 92: Building a Massively Scalable Cloud Service from the Grounds Up

2 types of search Full Text Search Structured Search

Page 93: Building a Massively Scalable Cloud Service from the Grounds Up

2 types of search Full Text Search Structured Search

Page 94: Building a Massively Scalable Cloud Service from the Grounds Up
Page 95: Building a Massively Scalable Cloud Service from the Grounds Up
Page 96: Building a Massively Scalable Cloud Service from the Grounds Up
Page 97: Building a Massively Scalable Cloud Service from the Grounds Up

Executive summary

Framework Why not?

________________

Page 98: Building a Massively Scalable Cloud Service from the Grounds Up

Executive summary

Framework Why not?

Lucene/compass

Only embedded, resource guzzler

________________

Page 99: Building a Massively Scalable Cloud Service from the Grounds Up

Executive summary

Framework Why not?

Lucene/compass

Only embedded, resource guzzler

solr Bad grails integration

________________

Page 100: Building a Massively Scalable Cloud Service from the Grounds Up

Executive summary

Framework Why not?

Lucene/compass

Only embedded, resource guzzler

solr Bad grails integration

sphynx No incremental index

________________

Page 101: Building a Massively Scalable Cloud Service from the Grounds Up
Page 102: Building a Massively Scalable Cloud Service from the Grounds Up
Page 103: Building a Massively Scalable Cloud Service from the Grounds Up
Page 104: Building a Massively Scalable Cloud Service from the Grounds Up

vs.

Page 105: Building a Massively Scalable Cloud Service from the Grounds Up

vs.

Page 106: Building a Massively Scalable Cloud Service from the Grounds Up

You ask

Page 107: Building a Massively Scalable Cloud Service from the Grounds Up

ElasticSearch answers

Page 108: Building a Massively Scalable Cloud Service from the Grounds Up
Page 109: Building a Massively Scalable Cloud Service from the Grounds Up

Additional Services

Page 110: Building a Massively Scalable Cloud Service from the Grounds Up

Additional Services

Indexes, Statistics, Logs

Page 111: Building a Massively Scalable Cloud Service from the Grounds Up
Page 112: Building a Massively Scalable Cloud Service from the Grounds Up
Page 113: Building a Massively Scalable Cloud Service from the Grounds Up
Page 114: Building a Massively Scalable Cloud Service from the Grounds Up
Page 115: Building a Massively Scalable Cloud Service from the Grounds Up

Also, Redis to the resque

Page 116: Building a Massively Scalable Cloud Service from the Grounds Up

Did they just add a 4th nosql?!

Page 117: Building a Massively Scalable Cloud Service from the Grounds Up
Page 118: Building a Massively Scalable Cloud Service from the Grounds Up
Page 119: Building a Massively Scalable Cloud Service from the Grounds Up

Additional Services

Documentation

Page 120: Building a Massively Scalable Cloud Service from the Grounds Up
Page 121: Building a Massively Scalable Cloud Service from the Grounds Up

DevOps

Page 122: Building a Massively Scalable Cloud Service from the Grounds Up

IaaS vs. SaaS

Page 123: Building a Massively Scalable Cloud Service from the Grounds Up

Leave it to the Pros

Page 124: Building a Massively Scalable Cloud Service from the Grounds Up
Page 125: Building a Massively Scalable Cloud Service from the Grounds Up
Page 126: Building a Massively Scalable Cloud Service from the Grounds Up
Page 127: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Download Service

Component SaaS

_________________

Page 128: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Download Service

Component SaaS

blob storage SL objectstore

_________________

Page 129: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Download Service

Component SaaS

blob storage SL objectstore

mapping Cloudant

_________________

Page 130: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Web and services

Component SaaS

_________________

Page 131: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Web and services

Component SaaS

Model Mongohq

_________________

Page 132: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Web and services

Component SaaS

Model Mongohq

Grails N/A

_________________

Page 133: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Web and services

Component SaaS

Model Mongohq

Grails N/A

ElasticSearch N/A

_________________

Page 134: Building a Massively Scalable Cloud Service from the Grounds Up

SaaS for Web and services

Component SaaS

Model Mongohq

Grails N/A

ElasticSearch N/A

Redis N/A

_________________

Page 135: Building a Massively Scalable Cloud Service from the Grounds Up
Page 136: Building a Massively Scalable Cloud Service from the Grounds Up
Page 137: Building a Massively Scalable Cloud Service from the Grounds Up
Page 138: Building a Massively Scalable Cloud Service from the Grounds Up

Physical vs. Virtual

Page 139: Building a Massively Scalable Cloud Service from the Grounds Up

Remember this?

Page 140: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________

Page 141: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros

Page 142: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

Page 143: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

– elastic

Page 144: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

– elastic – Volatile

Page 145: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

– elastic – Volatile cons

Page 146: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

– elastic – Volatile cons – Overhead

Page 147: Building a Massively Scalable Cloud Service from the Grounds Up

Virtualization __________ Pros – Cheap

– elastic – Volatile cons – Overhead – Tenant, not owner

Page 148: Building a Massively Scalable Cloud Service from the Grounds Up
Page 149: Building a Massively Scalable Cloud Service from the Grounds Up
Page 150: Building a Massively Scalable Cloud Service from the Grounds Up

Development Environment

Page 151: Building a Massively Scalable Cloud Service from the Grounds Up

Remember?

Page 152: Building a Massively Scalable Cloud Service from the Grounds Up

We are liberal

Page 153: Building a Massively Scalable Cloud Service from the Grounds Up

We are liberal

Page 154: Building a Massively Scalable Cloud Service from the Grounds Up

We are liberal

Page 155: Building a Massively Scalable Cloud Service from the Grounds Up

We are liberal

Page 156: Building a Massively Scalable Cloud Service from the Grounds Up
Page 157: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 158: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 159: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 160: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 161: Building a Massively Scalable Cloud Service from the Grounds Up

Chef What?

Page 162: Building a Massively Scalable Cloud Service from the Grounds Up

Opscode Chef

Page 163: Building a Massively Scalable Cloud Service from the Grounds Up

Opscode Chef

Page 164: Building a Massively Scalable Cloud Service from the Grounds Up

Opscode Chef

Page 165: Building a Massively Scalable Cloud Service from the Grounds Up

Opscode Chef

Page 166: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 167: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 168: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant Who?

Page 169: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant

Page 170: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant

Page 171: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant

Page 172: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant

Page 173: Building a Massively Scalable Cloud Service from the Grounds Up

Vagrant

Page 174: Building a Massively Scalable Cloud Service from the Grounds Up

Development

Page 175: Building a Massively Scalable Cloud Service from the Grounds Up

Development

Page 176: Building a Massively Scalable Cloud Service from the Grounds Up

Development

Page 177: Building a Massively Scalable Cloud Service from the Grounds Up

Development

Page 178: Building a Massively Scalable Cloud Service from the Grounds Up

Ops are part of the DevOps

Page 179: Building a Massively Scalable Cloud Service from the Grounds Up
Page 180: Building a Massively Scalable Cloud Service from the Grounds Up

1.  Vagrant boots centos on virtualbox

Page 181: Building a Massively Scalable Cloud Service from the Grounds Up

1.  Vagrant boots centos on virtualbox

2.  Chef installs all db and service rpms from private YUM repo

Page 182: Building a Massively Scalable Cloud Service from the Grounds Up

1.  Vagrant boots centos on virtualbox

2.  Chef installs all db and service rpms from private YUM repo

3.  Profit!

Page 183: Building a Massively Scalable Cloud Service from the Grounds Up

High Availability

(And Locality)

Page 184: Building a Massively Scalable Cloud Service from the Grounds Up

Cluster everything

Page 185: Building a Massively Scalable Cloud Service from the Grounds Up

Remember?

Page 186: Building a Massively Scalable Cloud Service from the Grounds Up
Page 187: Building a Massively Scalable Cloud Service from the Grounds Up

CDN for Download Server

Page 188: Building a Massively Scalable Cloud Service from the Grounds Up
Page 189: Building a Massively Scalable Cloud Service from the Grounds Up

GTD for Web Application

Page 190: Building a Massively Scalable Cloud Service from the Grounds Up
Page 191: Building a Massively Scalable Cloud Service from the Grounds Up

Backup

(and Vendor Lock-Out)

Page 192: Building a Massively Scalable Cloud Service from the Grounds Up
Page 193: Building a Massively Scalable Cloud Service from the Grounds Up
Page 194: Building a Massively Scalable Cloud Service from the Grounds Up
Page 195: Building a Massively Scalable Cloud Service from the Grounds Up

Snapshots and replicas

Page 196: Building a Massively Scalable Cloud Service from the Grounds Up

Monitoring

(Servers, State and Logs)

Page 197: Building a Massively Scalable Cloud Service from the Grounds Up
Page 198: Building a Massively Scalable Cloud Service from the Grounds Up
Page 199: Building a Massively Scalable Cloud Service from the Grounds Up

Prevent this:

Page 200: Building a Massively Scalable Cloud Service from the Grounds Up
Page 201: Building a Massively Scalable Cloud Service from the Grounds Up

Going to Production…

Page 202: Building a Massively Scalable Cloud Service from the Grounds Up

Remember?

Page 203: Building a Massively Scalable Cloud Service from the Grounds Up
Page 204: Building a Massively Scalable Cloud Service from the Grounds Up

The Solution

Page 205: Building a Massively Scalable Cloud Service from the Grounds Up
Page 206: Building a Massively Scalable Cloud Service from the Grounds Up
Page 207: Building a Massively Scalable Cloud Service from the Grounds Up
Page 208: Building a Massively Scalable Cloud Service from the Grounds Up
Page 209: Building a Massively Scalable Cloud Service from the Grounds Up
Page 210: Building a Massively Scalable Cloud Service from the Grounds Up

All together now

Page 211: Building a Massively Scalable Cloud Service from the Grounds Up
Page 212: Building a Massively Scalable Cloud Service from the Grounds Up

Conclusions time ______________

Page 213: Building a Massively Scalable Cloud Service from the Grounds Up

Conclusions time

– Define Criticality

______________

Page 214: Building a Massively Scalable Cloud Service from the Grounds Up

Conclusions time

– Define Criticality – Embrace the change

______________

Page 215: Building a Massively Scalable Cloud Service from the Grounds Up

Conclusions time

– Define Criticality – Embrace the change – Plan for scale, but be realistic

______________

Page 216: Building a Massively Scalable Cloud Service from the Grounds Up

Conclusions time

– Define Criticality – Embrace the change – Plan for scale, but be realistic

– Backup everything!

______________

Page 217: Building a Massively Scalable Cloud Service from the Grounds Up

No, thank you!