Scalable service architectures @ BWS16
-
Upload
zoltan-nemeth -
Category
Technology
-
view
271 -
download
0
Transcript of Scalable service architectures @ BWS16
![Page 1: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/1.jpg)
Scalable Service Architectures
Lessons learned
Zoltán NémethEngineering Manager, Core SystemsAn IBM company
![Page 2: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/2.jpg)
Agenda Our scalability
experience What is Scalability? Requirements in detail Tips and tools Extras, Closing remarks
![Page 3: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/3.jpg)
Our experience
![Page 4: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/4.jpg)
Streaming stack
![Page 5: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/5.jpg)
![Page 6: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/6.jpg)
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 7: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/7.jpg)
Self-contained service
Explicitly declare and isolate dependencies
Isolation from the outside system Static linking
Do not rely on system packages
![Page 8: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/8.jpg)
Disposability Maximize robustness with fast startup and graceful shutdown
Disposable processes Graceful shutdown on
SIGTERM Handling sudden death:
robust queue backend
![Page 9: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/9.jpg)
Startup and Shutdown
Automate all the things Chef Docker Gold image based
deployment Immutable
Handling tasks before shutdown
![Page 10: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/10.jpg)
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 app
![Page 11: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/11.jpg)
Processes, concurrency
Stateless processes (not even sticky sessions)
Process types by work type
We <3 linux process Shared-nothing
adding concurrency is safe
Process distribution spanning machines
![Page 12: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/12.jpg)
Statelessness Store everything in a datastore
Aggregate data Chandra Aggregator / map &
reduce Scalable datastores Handling user sessions
![Page 13: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/13.jpg)
Monitoring Application state and metrics Dashboards Alerting
Health Remove failing
nodes Capacity
Act on trends
![Page 14: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/14.jpg)
Monitoring Metrics collecting Graphite, New Relic
Self-aware checks Cluster state
Zookeeper, Consul Scaling decision types
Capacity amount Graph derivative App requests
![Page 15: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/15.jpg)
![Page 16: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/16.jpg)
Load Balance and Resource Allocation
Load Balance: distribute tasks Utilize machines
efficiently VM compatible apps
Flexibility Adapting to
available resources
![Page 17: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/17.jpg)
Load Balance DNS or API App level balance
Uniform entry point or proxy
Balance decisions Load Zookeeper state Resource policies
![Page 18: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/18.jpg)
Service Separation
Failure is inevitable Protect from failing
components Cascading failure Fail fast Decoupling Asynchronous
operations Message queues
![Page 19: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/19.jpg)
Service Separation
Rate limiting Circuit Breaker pattern
Stop cascading failure, allow recovery
Hystrix Fail fast, fail silent
Service decoupling
![Page 20: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/20.jpg)
Extras Debugging features Logs Clojure / JS consoles Runtime
configuration via env
Scaling API Integrating several
cloud providers Automatic start /
stop
![Page 21: Scalable service architectures @ BWS16](https://reader035.fdocuments.us/reader035/viewer/2022062901/58f28d281a28ab43458b4573/html5/thumbnails/21.jpg)
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