Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

38
NYT faбrik TimesOpen – 12 September 2012

Transcript of Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

Page 1: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

NYT faбrik

TimesOpen – 12 September 2012

Page 2: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

2

Who

Architect Infrastructure Group Previous

– US Army– Harvard– Tech companies– United Nations

Page 3: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

3

What we’ll cover

A story faбrik overview Code and demo

Page 4: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

4

Takeaways

Application Developer– Demand ‘events’ (no polling, no thanks, been there, done that)– Demand infrastructure that scales and you don’t have to worry about

Infrastructure Engineer– Decouple, flatten, simplify– Outsource complexity

Page 5: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

5

The Story: Harvard U, 1986+

Bad: – No Internet (pre-web)– data locked in mainframe– large central clerical staff– monolithic central systems

Good:– Vision of an Information Utility– desire to innovate– lots of desktop computers (30,000)– email everywhere although over diverse networks and technologies

Page 6: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

6

The Story: Harvard U, 1986+

Solution: – Relational database (decouple data from application)– Email backbone (decouple producers from consumers)– Event-driven desktop applications (flatten)– Identical code on mainframe (simplify)

Result:– Data warehouse unlocked (before the term was coined)– Central clerical staff functions upgraded/dispersed– Old central systems replaceable and, ultimately, replaced– Happy users!

Page 7: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

7

faбrik – Why?

?

Page 8: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

8

NYT Mission

Enhance society by creating, collecting and distributing high quality news, information and entertainment

- Distributing: publish / subscribe- Collecting: gather / analyze- High Quality: fast, reliable, accurate

Page 9: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

9

faбrik

Asynchronous Messaging Framework

For client devices as well as our apps

Enabled by:– Websockets– Robust message handling software– Amazon Web Services

Focusing on simple, common services

Page 10: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

10

faбrik – solve the problem!

App

Page 11: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

11

faбrik – basic

App

App

App

Message Broker

Page 12: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

12

faбrik – basic

App

App

App

Message Broker

Amazon Web Services

• EC2• S3• Identity &

Access Mgt• DynamoDB• Route 53…

Page 13: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

13

faбrik – basic++

OtherApp

AppBuddy

Service Buddy

Message Broker

Message Broker

Service Buddy

“Retail”

“Wholesale”

Page 14: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

14

faбrik: Current Implementation

Open source– Erlang/OTP– RabbitMQ– Nodejs – Sockjs (websockets +)– Python (gevent, select/epoll, tornado, futures, …)– ZeroMQ (new)

Automated build/deployment

Page 15: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

15

faбrik – active/active cluster

Service Buddy

‘a’

Service Buddy

‘b’

Zone ‘a’ Zone ‘b’

Region Wherever

Page 16: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

16

faбrik – active/active cluster

Service Buddy

‘a’

Service Buddy

‘b’

Zone ‘a’ Zone ‘b’

Region Wherever

Got your back!

Got yours too!

Page 17: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

17

faбrik

Page 18: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

18

faбrik

Page 19: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

19

faбrik

Page 20: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

20

faбrik – Layers

Page 21: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

21

faбrik – Layers

Page 22: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

22

faбrik – Layers

Page 23: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

23

faбrik – Layers

Page 24: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

24

Page 25: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

25

Page 26: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

26

Pub / Sub

Page 27: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

27

Pub / Sub

Page 28: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

28

Pub / Sub

Page 29: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

29

Pub / Sub

Page 30: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

30

Pub / Sub

Page 31: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

31

Gather / Analyze

Page 32: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

32

Gather / Analyze

Page 33: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

33

Gather / Analyze

Page 34: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

34

Gather / Analyze

Page 35: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

35

Gather / Analyze

Page 36: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

36

Gather / Analyze

Page 37: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

37

Gather / Analyze

Page 38: Faбrik - TimesOpen: Sockets and Streams - Sept. 2012

38

faбrik

Demo

Code

App