+ All Categories
Home > Software > Building Applications with the Typesafe Reactive Platform at Skills Matter, London, November 17,...

Building Applications with the Typesafe Reactive Platform at Skills Matter, London, November 17,...

Date post: 19-Feb-2017
Category:
Upload: lutz-huehnken
View: 262 times
Download: 1 times
Share this document with a friend
37
Building Applications with the Typesafe Reactive Platform Lutz Huehnken - Solutions Architect @lutzhuehnken
Transcript

Building Applications with the Typesafe Reactive Platform

Lutz Huehnken - Solutions Architect

@lutzhuehnken

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.

Reactive Platform Versioning

15v01p05

yearmonth

patch =Scala 2.11.2Akka 2.3.3…

15v09p01 =Scala 2.11.7Akka 2.3.12 …

https://together.typesafe.com/products/reactivePlatform

Split Brain Resolver

(Slides courtesy of Konrad Malawski)

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

Heartbeats

A

heartbeats

heartbeats

Heartbeats

A

heartbeats

heartbeats

everyone is down!

Heartbeats

A

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

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.

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

A

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

we need to down ourselves

A

Keep Majority (aka. dynamic quorum)

A

Keep Majority (aka. dynamic quorum)

A

we need to down ourselves

referee node

Keep Referee

A

down-all-if-less-than-nodes

referee node

Keep Referee

A

can’t see referee node!

down-all-if-less-than-nodes

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.

Monitoring

Monitoring Async Apps—New Challenges

• Context is lost

• Stack traces less useful

• Expensive to collect all steps

Monitoring Async Apps—Too Much Data

• Which actors do we track?

• What do we keep?

• What do we filter out?

• What do we aggregate?

Instrumentation

• Instrumented Reactive Platform

• Configurable actor metrics

• Actor-specific events

• Traces across actors

Instrumentation

• Instrumented Reactive Platform

• Configurable actor metrics

• Actor-specific events

• Traces across actors

Play User Quotas

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.

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.

Play User Quotas

• Per „account“ - can be IP, username, etc.

• Works standalone and in a cluster!

ConductR

Reactive for DevOps

What is ConductR?

28

ConductR is a solution for deploying and managing reactive applications across a cluster of machines.

Microservice Trade-offs

29

..according to Mr. Martin Fowler

- Distribution

- Eventual Consistency

- Operational Complexity

Reactive for DevOps

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!

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

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

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.zipconduct run 274dfbcconduct run —scale=3 274dfbcconduct stop 274dfbcconduct unload 274dfbc

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")

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

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

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


Recommended