Slide 1

Slide 1 text

Building Applications with the Typesafe Reactive Platform Lutz Huehnken - Solutions Architect @lutzhuehnken

Slide 2

Slide 2 text

What is the Reactive Platform (RP)? ● RP is targeted towards enterprises that are launching and maintaining Reactive applications in production. ● A curated, certified build for simplified development and deployment ● Additional features not available in the open source projects.

Slide 3

Slide 3 text

Reactive Platform Versioning 15v01p05 year month patch = Scala 2.11.2 Akka 2.3.3 … 15v09p01 = Scala 2.11.7 Akka 2.3.12 … https://together.typesafe.com/products/reactivePlatform

Slide 4

Slide 4 text

Split Brain Resolver (Slides courtesy of Konrad Malawski)

Slide 5

Slide 5 text

Split Brain Resolver • Fundamental Problem in all distributed systems • SBR helps to make decisions, is not a magic wand • A set of pre-built strategies 
 for when to down nodes in a cluster. • Strategies: • Static Quorum (like zoo-keeper) • Keep Majority • Keep Oldest • Keep Referee http://doc.akka.io/docs/akka/rp-15v09p02/scala/split-brain-resolver.html

Slide 6

Slide 6 text

Heartbeats A heartbeats heartbeats

Slide 7

Slide 7 text

Heartbeats A heartbeats heartbeats everyone is down!

Slide 8

Slide 8 text

Heartbeats A `n-1` is down! I’ll take over `A`!

Slide 9

Slide 9 text

Heartbeats A `n-1` is down! I’ll take over `A`! A good if: n-1 really is down. bad: if n-1 is just very unresponsive Fundamentally, it is hard to distinguish the two states in distributed systems.

Slide 10

Slide 10 text

Static Quorum (3 (> (n/2 +1)) A

Slide 11

Slide 11 text

Static Quorum (3 (> (n/2 +1)) we need to down ourselves A

Slide 12

Slide 12 text

Keep Majority (aka. dynamic quorum) A

Slide 13

Slide 13 text

Keep Majority (aka. dynamic quorum) A we need to down ourselves

Slide 14

Slide 14 text

referee node Keep Referee A down-all-if-less-than-nodes

Slide 15

Slide 15 text

referee node Keep Referee A can’t see referee node! down-all-if-less-than-nodes

Slide 16

Slide 16 text

oldest node Keep Oldest A can’t see oldest node! down-if-alone oldest node can change, if “up until now oldest node” leaves the cluster. This is more dynamic than keep-referee.

Slide 17

Slide 17 text

Monitoring

Slide 18

Slide 18 text

Monitoring Async Apps—New Challenges • Context is lost • Stack traces less useful • Expensive to collect all steps

Slide 19

Slide 19 text

Monitoring Async Apps—Too Much Data • Which actors do we track? • What do we keep? • What do we filter out? • What do we aggregate?

Slide 20

Slide 20 text

Instrumentation • Instrumented Reactive Platform • Configurable actor metrics • Actor-specific events • Traces across actors

Slide 21

Slide 21 text

Instrumentation • Instrumented Reactive Platform • Configurable actor metrics • Actor-specific events • Traces across actors

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Play User Quotas

Slide 24

Slide 24 text

Play User Quotas • Control the service level that you provide to your users. • Quotas lets you track each user’s usage and restrict access when usage exceeds limits that you set.

Slide 25

Slide 25 text

Play User Quotas Use Cases • On public websites, to stop users scraping your site. • When you’re providing a developer API for your website. APIs enforce rate limits - to get access to higher limits a developers need to validate their identity or pay a fee. • In your organization. You can provision and allocate resources fairly, you can ensure other internal users get clear feedback when they exceed agreed usage. • To limit how much data users upload in a period of time, to prevent your service being overloaded. • To slow down login attempts or other sensitive actions.

Slide 26

Slide 26 text

Play User Quotas • Per „account“ - can be IP, username, etc. • Works standalone and in a cluster!

Slide 27

Slide 27 text

ConductR

Slide 28

Slide 28 text

Reactive for DevOps What is ConductR? 28 ConductR is a solution for deploying and managing reactive applications across a cluster of machines.

Slide 29

Slide 29 text

Microservice Trade-offs 29 ..according to Mr. Martin Fowler
 - Distribution - Eventual Consistency - Operational Complexity Reactive for DevOps

Slide 30

Slide 30 text

Reactive for DevOps Microservice Trade-offs 30 - You need a mature operations team to manage lots of services, which are being redeployed regularly. And/or a tool that significantly simplifies that!

Slide 31

Slide 31 text

Reactive for DevOps Operational Complexity 31 So what do you really need in your operations environment to simplify things? - Convenient deployment format (e.g. in single-file format, ensuring consistency) - Convenient interface (to deploy, run, scale) - Service Lookup - Resiliency

Slide 32

Slide 32 text

Reactive for DevOps Deployment format 32 ConductR bundles - Contain all library dependencies of your app - And the configuration - SHA is generated and encoded in the file name - Unique identification, and consistency check - easy to create, with sbt or shazar ferry-boat-1.0-274dfbcb2946a41d4fa5d259578a9761aa0bf2a49d3b397f9cd2c6d772c78577.zip

Slide 33

Slide 33 text

Reactive for DevOps Deploy, run, scale 33 - ConductR control protocol is a REST api - Great for automation, building REST clients should be easy enough - In fact, we provide a simple one for the command line conduct load ferry-boat-1.0-274dfbcb2946a..c78577.zip conduct run 274dfbc conduct run —scale=3 274dfbc conduct stop 274dfbc conduct unload 274dfbc

Slide 34

Slide 34 text

Reactive for DevOps Service lookup 34 - Lookup service by assigned name - No need for additional infrastructure - „static“ (fail fast) or „dynamic“ BundleKeys.endpoints := Map(
 "ferry" -> Endpoint("http", services = Set(URI("http://:9666/ferry")))) === LocationService.getLookupUrl("/ferry", "http://127.0.0.1:9666")

Slide 35

Slide 35 text

Reactive for DevOps Resilience 35 - Any operations environment can only do so much. There’s no magic. - ConductR improves resiliency through: - Location transparency / proxying - handling node failure - the control protocol

Slide 36

Slide 36 text

HA Proxy integration (incl. re-configuration through cluster events) for resiliency

Slide 37

Slide 37 text

©Typesafe 2015 – All Rights Reserved ©Typesafe 2015 – All Rights Reserved