akka - scale 16x · stateful architecture shopping more search tools images videos wut? about...

22
Stateful Architectures in Akka Nick Isaacs @jorge_distress Sr. VP Fungineering @

Upload: trinhnhi

Post on 10-Aug-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Stat

eful

Arc

hite

ctur

es in

A

kka

Nic

k Is

aacs

@jo

rge_

dist

ress

Sr.

VP

Fun

gine

erin

g @

Wha

t Is

This

Tal

k?

●A

necd

otal

●In

form

atio

nal

●A

wor

k in

pro

gres

s●

Firs

t ste

ps

Why

Com

puters

Users

Sta

tefu

l Arc

hite

ctur

e

Sta

tefu

l wha

t?

Sta

tele

ss A

rchi

tect

ures

A ty

pica

l loa

d ba

lanc

ed A

PI s

erve

r clu

ster

Load

B

alan

cer

AP

IS

ER

VE

R

AP

IS

ER

VE

R

AP

IS

ER

VE

R

DB

Sta

tele

ss R

eque

st F

low

1.H

it lo

ad b

alan

cer

2.H

it A

PI b

ox3.

Look

up s

tate

from

per

sist

ence

laye

r4.

???

5.R

espo

nd6.

Pro

fit

Sta

tele

ss R

eque

st F

low

1.H

it lo

ad b

alan

cer

2.H

it A

PI b

ox3.

Look

up s

tate

from

per

sist

ence

laye

r4.

???

5.R

espo

nd6.

Pro

fit

Sta

tefu

l Req

uest

Flo

w

1.H

it lo

ad b

alan

cer

2.H

it A

PI b

ox3.

Look

up s

tate

from

per

sist

ence

laye

r4.

???

5.R

espo

nd6.

Pro

fit

Stra

tegi

es

●E

phem

eral

app

licat

ions

(avo

id s

tate

)●

Cac

hing

●S

hard

ing

Sta

tefu

l Arc

hite

ctur

eA

sta

tefu

l AP

I clu

ster

. Eac

h no

de h

as a

sub

set o

f the

app

licat

ion

dom

ain.

AP

IS

ER

VE

R

AP

IS

ER

VE

R

AP

IS

ER

VE

R

1-3

4-6

7-9

DB

Sha

rdin

g A

pplic

atio

ns

●K

eepi

ng d

ata/

logi

c in

a k

now

n pl

ace

●M

embe

rshi

p●

Con

sist

ent h

ashi

ng●

Rou

ting

●C

oord

inat

ion

Wha

t is

Akk

a?

●A

ctor

impl

emen

tatio

n on

the

JVM

●A

ctor

s se

nd a

nd re

ceiv

e m

essa

ges

●A

ctor

s ca

n “b

ecom

e” a

new

sta

te b

etw

een

mes

sage

s●

Act

ors

are

“isla

nds

of s

tate

”●

You

can

not d

irect

ly a

cces

s an

Act

or’s

sta

te●

Man

y gr

eat i

ntro

talk

s/po

sts

avai

labl

e

Akk

a to

the

Res

cue

●Fa

ntas

tic a

bstra

ctio

n of

sta

te●

Per

sist

ent a

ctor

s●

Ric

h m

essa

ge d

eliv

ery

sem

antic

s●

Sim

ple

mes

sage

pas

sing

acr

oss

the

netw

ork

●Fa

ilure

is a

firs

t cla

ss c

itize

n

A L

ittle

Exa

mpl

e

●Te

mpe

ratu

reA

ctor

●A

ll of

the

stat

e is

man

aged

in m

emor

y●

Faul

t tol

eran

t, re

play

able

log

of o

ur c

urre

nt s

tate

http

s://g

ithub

.com

/nic

ky-is

aacs

/SC

ALE

-14x

-dem

o

1. A

ctor

com

es to

life

, tim

e to

read

bac

k th

e st

ate

2. A

ctor

is re

cove

red,

tim

e to

w

ork

●R

ecov

erin

g○

No

mes

sage

s fro

m th

e ou

tsid

e w

orld

○R

eadi

ng s

naps

hots

and

jour

nale

d m

essa

ges

○G

ettin

g ba

ck to

last

kno

wn

stat

e

●R

ecei

ving

○R

eady

to re

spon

d to

the

wor

ld○

Sta

te c

hang

es g

o to

dis

k as

ynch

rono

usly

○w

rites

are

all

in m

emor

y, p

erfo

rman

ce++

Fini

te S

tate

Mac

hine

(tha

nks

Akk

a)

How

We

Clu

ster

Tod

ay

●S

tate

ful s

hard

ing

of a

pplic

atio

ns●

Zook

eepe

r bas

ed m

embe

rshi

p●

Con

sist

ently

has

hed

by o

rgan

izat

ion

●S

ingl

e le

ader

Whe

re W

e C

ould

Go

●Le

ader

less

clu

ster

s●

Gos

sip

mem

bers

hip

prot

ocol

●R

eplic

atio

n of

wor

k as

clu

ster

sc

ales

Ext

ra C

redi

t

●U

ber R

ingp

op○

“app

licat

ion-

laye

r sha

rdin

g fo

r Nod

e.js

ap

plic

atio

ns”

●A

kka

Clu

ster

ing

●D

ynam

o pa

per

“I re

gret

not

hing

. The

end

.”

- Ron

Sw

anso

n