Slide 1

Slide 1 text

Kuiperbelt Asynchronous protocol proxy for prefork backend.

Slide 2

Slide 2 text

Who am I ? • twitter: @mackee_w • PAUSE ID: MACOPY • github: github.com/mackee • Yokohama.pm Co-mainterner(?)

Slide 3

Slide 3 text

What’s kuiperbelt? • Asynchronous protocol =WebSocket • Other protocols(not implement): • HTTP2 MQTT memd(!?) etc…

Slide 4

Slide 4 text

What’s kuiperbelt? • kuiperbelt is… • WebSocket to HTTP1.x converter • proxy, authentication mechanism and connection pooling

Slide 5

Slide 5 text

Motivation • Prefork(or blocking/synchronous) server has a problem of about using websocket protocol. • Problems: • C10k • AnyEvent(Perl)/Eventmachine(Ruby) -> RDB Transaction • shared connection -> sticky session(?)

Slide 6

Slide 6 text

Conventional solution • Switch to a language that support concurrent • code to trash!!! oh!!!! • pray and close eyes • C10k???? my code is not graceful but working now.

Slide 7

Slide 7 text

OTOH, Realtime application age • Server-side push • realtime paging???? huh????? • Planner’s imagination is infinite.

Slide 8

Slide 8 text

kuiperbelt flow: connection

Slide 9

Slide 9 text

Kuiperbelt flow: connection client kuipetbelt backend

Slide 10

Slide 10 text

Kuiperbelt flow: connection client kuipetbelt backend GET /connect
 with Upgrade

Slide 11

Slide 11 text

Kuiperbelt flow: connection client kuipetbelt backend proxy to endpoint

Slide 12

Slide 12 text

Kuiperbelt flow: connection client kuipetbelt backend authentication proxy query string and header

Slide 13

Slide 13 text

Kuiperbelt flow: connection client kuipetbelt backend response
 with session key header

Slide 14

Slide 14 text

Kuiperbelt flow: connection client kuipetbelt backend register session key

Slide 15

Slide 15 text

Kuiperbelt flow: connection client kuipetbelt backend upgrade to websocket

Slide 16

Slide 16 text

Kuiperbelt flow: server-side push

Slide 17

Slide 17 text

Kuiperbelt flow: server-side push client kuipetbelt backend POST /send with session key header

Slide 18

Slide 18 text

Kuiperbelt flow: server-side push client kuipetbelt backend search session by key

Slide 19

Slide 19 text

Kuiperbelt flow: server-side push client kuipetbelt backend write body to connection

Slide 20

Slide 20 text

other features • server-side closing with message • close callback to backend by client- side normally closing • switch binary/text frame

Slide 21

Slide 21 text

clusters • kuiperbelt is support single host application only. • But does not mean there is no way. • Kuiperbelt server host name in header of /connect callback. • If you want to connection mapping to some kuiperbelt host, store this hostname in datastore.

Slide 22

Slide 22 text

implementation plan • (really) cluster support • Redis Pub/Sub or MQTT backbone • DHT and sticky session? • documentation (oh…

Slide 23

Slide 23 text

Please try it!!! github.com/mackee/kuiperbelt

Slide 24

Slide 24 text

Thank you!