Scalable service architectures @ VDB16

26
Scalable Service Architectures Lessons learned Zoltán Németh Sr Engineering Manager, Streaming & Player An IBM company

Transcript of Scalable service architectures @ VDB16

Page 1: Scalable service architectures @ VDB16

Scalable Service Architectures

Lessons learned

Zoltán Németh Sr Engineering Manager, Streaming & PlayerAn IBM company

Page 2: Scalable service architectures @ VDB16

Founded in 2007, acquired by IBM in 2016

Live streaming and VOD Freemium / Pro / Demand / Align

An IBM company

Page 3: Scalable service architectures @ VDB16

Streaming flow

Page 4: Scalable service architectures @ VDB16
Page 5: Scalable service architectures @ VDB16

Now back to 2009...

Page 6: Scalable service architectures @ VDB16
Page 7: Scalable service architectures @ VDB16
Page 8: Scalable service architectures @ VDB16

Earthquake in Japan

Protests in Ukraine, Egypt, Syria

Asteroid Approach

SpaceX Launch

El Classico

Page 9: Scalable service architectures @ VDB16
Page 10: Scalable service architectures @ VDB16

We must scale

Page 11: Scalable service architectures @ VDB16

Defining scalabilityScalability is the ability to handle increased workload by repeatedly applying a costeffective strategy for extending a system’s capacity.(CMU paper, 2006)

How well a solution to some problem will work when the size of the problem increases. When the size decreases, the solution must fit. (dictionary.com and Theo Schlossnagle, 2006)

Page 12: Scalable service architectures @ VDB16

Self-contained service

Explicitly declare and isolate dependencies

Isolation from the outside system Static linking Pay attention to GPL

Do not rely on system packages

Page 13: Scalable service architectures @ VDB16

Disposability Maximize robustness with fast startup and graceful shutdown

Disposable processes Graceful shutdown on

SIGTERM Handling sudden death:

robust queue backend

Page 14: Scalable service architectures @ VDB16

Backing Services

Treat backing services as attached resources

No distinction between local and third party services

Easily swap out resources

Export services via port binding

Become the backing service for another appDrawing source: 12factor.net

Page 15: Scalable service architectures @ VDB16

Processes, concurrency

Stateless processes (not even sticky sessions)

Process types by work type

We <3 linux process Container > VM Shared-nothing

adding concurrency is safe

Process distribution spanning machines

Page 16: Scalable service architectures @ VDB16

Statelessness Store everything in a datastore

Aggregate data Aggregator / map &

reduce CQEngine Chandra

Scalable datastores Handling user sessions

Page 17: Scalable service architectures @ VDB16

Microservices Self-contained Disposable Stateless Shared-nothing API communication Dependency

management moved to external Be Warned!

Image credits: christofcoetzee.co.za, techblog.netflix.com

Page 18: Scalable service architectures @ VDB16

Monitoring Metrics collecting Graphite, New Relic

Self-aware applications Cluster state

Zookeeper, Consul Scaling decisions

Capacity amount Graph derivative App requests

Page 19: Scalable service architectures @ VDB16
Page 20: Scalable service architectures @ VDB16

Load Balance DNS or API App level balance

Uniform entry point or proxy

Balance decisions Load Zookeeper state Resource policies

Page 21: Scalable service architectures @ VDB16

Service Separation

Rate limiting Failure is inevitable Circuit Breaker pattern

Stop cascading failure, allow recovery

Fail fast, fail silent Hystrix

Service decoupling Asynchronous

operations

Page 22: Scalable service architectures @ VDB16

Deployment Automate all the things Chef & VMs Docker Immutable deployment

Docker / Kubernetes / Rancher

Handling tasks before shutdown

Page 23: Scalable service architectures @ VDB16
Page 24: Scalable service architectures @ VDB16

Extras Debugging features Log processing:

Logstash, Kibana Clojure / JS consoles Runtime

configuration via env

Scaling API Cloud providers Automatic start /

stop

Page 25: Scalable service architectures @ VDB16

Reading Scalable Internet Architectures by Theo Schlossnagle The 12-factor App: http://12factor.net/ Carnegie Mellon Paper: http://www.sei.cmu.edu/reports/06tn012.pdf Circuit Breaker: http://martinfowler.com/bliki/CircuitBreaker.html Release It! by Michael T. Nygard Netflix Tech Blog: http://techblog.netflix.com/

Page 26: Scalable service architectures @ VDB16

Questions?

[email protected]