scaling marketplace to 10,000 add-ons - arun bhalla

52
#atlassian

Upload: atlassian

Post on 18-Nov-2014

126 views

Category:

Software


2 download

DESCRIPTION

In two years, we've transformed Atlassian Marketplace from a simple Rails application to a highly available SaaS service with thousands of add-ons and millions of dollars in transactions. Marketplace team lead Arun Bhalla will guide you through lessons learned building Scala web applications that scale.

TRANSCRIPT

Page 1: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

#atlassian

Page 2: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

ARUN BHALLA • DEVELOPMENT TEAM LEAD • ATLASSIAN

Scaling Marketplace to 10,000 Add-Ons

Page 3: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 4: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 5: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 6: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 7: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Marketplace roles

• Add-on search• Add-on listings• Ratings and reviews• Email notifications• Update checks• Adding new releases

• Hosting binaries• Pricing• License reporting• Sales reporting• Vendor management• Add-on approvals

Page 8: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

24,938,198Requests per day

Page 9: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

13,462Requests per second at peak

Page 10: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Who’s this guy?

Page 11: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

In the beginning

Website

Server

Database

httpdTomcat

Groovy on Grails

Java/J2EE Hibernate

PostgreSQL

Page 12: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Evolution

Website

Server

Database

httpdTomcat

Groovy/Grails

Java/J2EE Hibernate

PostgreSQL

Website

Database

httpd

Scala

MongoDB

Page 13: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

I’ve got 99 problems, but a null ain’t one.

Page 14: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

The adventure begins

Website

MongoDB

httpd

MongoDB

Crowd

Page 15: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 16: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

The homepage is slow!

Page 17: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

You can’t improve what you don’t

measure.

Page 18: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Profiling with YourKit

Page 19: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Optimize data retrieval for cases.

Page 20: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Cache in HTTP

Page 21: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

varnishlog

varnishreplay

varnishtop

varnishstat

Page 22: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Apply the Varnish

Website

MongoDB

httpd

MongoDB

Crowd

Varnish

Page 23: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 24: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Edge Side Includes (ESI)

Page 25: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Use a CDN

Page 26: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

CDN to the rescue

Page 27: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Enter CloudFront

MongoDB MongoDB

Website

httpd

Crowd

VarnishCloudFront

Page 28: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Flat response time

Page 29: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Monitor everything

Page 30: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Pingdom

Page 31: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

New Relic

Page 32: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

MongoDB Management Service

Page 33: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Nagios + Cacti

Page 34: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 35: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

The site is slow!

Page 36: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Add more app servers

Page 37: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Double down

MongoDB MongoDB

Website

nginx

Crowd

VarnishCloudFront

Website

Page 38: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Write-through memcached

MongoDB MongoDB

Website

httpd

Crowd

VarnishCloudFront

Website

memcached

Page 39: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Add more database servers

Page 40: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Three’s company

MDB MDB

Website

nginx

Crowd

VarnishCloudFront

Website

memcached

MDB

Page 41: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

The site is unavailable during

deploys!

Page 42: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

One node…

App

Page 43: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Two nodes…

App1

App2

Page 44: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Three nodes!

App1

App2

App3

Page 45: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Three’s company

MDB MDB

Web

nginx

Crowd

VarnishCloudFront

Web

memcached

MDB

Web

HAProxy

VarnishHAProxy

Page 46: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Bad timing

App1

App2

App3

Page 47: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

Coordinated deploys

App1

App2

App3

Deployment Engine

Page 48: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 49: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla
Page 50: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

We’re in AWS

MDB MDB

Web

nginx

VarnishCloudFront

Web

memcached

MDB

Web

HAProxy

Varnish

HAProxy

MDB MDB

WebWeb

HAProxy

Page 51: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

#atlassianKey takeaways:

• All you need for DevOps is a brain, heart, and courage.• Open-source tools will get you pretty far.• Build your systems with scalability in mind.• Look to the cloud for flexibility.

Page 52: Scaling Marketplace to 10,000 Add-Ons  - Arun Bhalla

ARUN BHALLA • DEVELOPMENT TEAM LEAD • ATLASSIAN

Thank you!