cto at numberly gentoo linux developer · designing a scalable and distributed application...

39
Gentoo Linux developer CTO at Numberly @ultrabug © Eric Fischer / Flickr

Upload: others

Post on 23-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Gentoo Linux developerCTO at Numberly

@ultrabug

© Eric Fischer / Flickr

Page 2: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Designing a scalable and distributed application

EuroPython 2015

© Eric Fischer / Flickr

Page 3: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

USA ⇄ EUROPE

Geo distributed page hit counter web application

© Highways England / Flickr

Page 4: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

spans over multiple and distant datacenters

#1Multi Datacenter

© Catherine Holmes

Page 5: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

sum of the page hits from all the datacenters

#2A unique page hit count

© Catherine Holmes

Page 6: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

no manual application (re)configuration

#3Automatic resizing

© Catherine Holmes

Page 7: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

immediately available to all web services

#4Distributed configuration

© Catherine Holmes

Page 8: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

...that’s some kind of contract !

Hell...

© C. K. Koay / Flickr

Page 9: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

be lazy !

Rely on your stack

© Tripp / Flickr

Page 10: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Zen of pythonif the technology is hard to explain,

it's a bad idea

© HumanOS

Page 11: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

UNIX tools philosophykeep it small and simple

© Jason Scott / Flickr

Page 12: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Isolated componentsbreaking it down to pieces

© Blake Thornberry / Flickr

Page 13: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

distributed architecture style

Microservices

© Martin Grandjean / wikipedia

Page 14: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

micromanagement = high operational cost

Microservices

© Martin Grandjean / wikipedia

Page 15: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Communication reliabilitynetwork latency and failure

© Steven Shorrock / Flickr

Page 16: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

Locality vs consistencydata access lag or outage

© R2 HOX / Flickr

Page 17: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

feature rich application stack

nginx + uWSGI

© Terabass / wikipedia

Page 18: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

⇨ gets HTTP requests ⇨ produces jobs

⇦ returns the total hit count

collector

Page 19: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

consumes jobs ⇨ increments a counter

processor

Page 20: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 21: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

simple and reliable job queue server

beanstalkd

© Mooms

Page 22: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 23: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 24: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 25: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 26: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

automated scaling and fault tolerance

Service discovery

© Cambridge University / wikipedia

Page 27: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

multi datacenter + key / value storage

Consul

Page 28: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 29: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

seamless service registration / health check

uWSGI consul plugin

Page 30: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

consul-register = url=http://localhost:8500,name=my_service

Page 31: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

to victory

Let’s build this up

© Brian Rincker / Flickr

Page 32: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 33: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 34: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 35: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 36: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 37: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr
Page 38: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

(hopefully)

Live demo !

© shoutmeloud / Pinterest

Page 39: CTO at Numberly Gentoo Linux developer · Designing a scalable and distributed application EuroPython 2015 © Eric Fischer / Flickr

source code : github.com/ultrabug/ep2015@ultrabug

Thanks

© Eric Fischer / Flickr